Skip to content

Add Configuration File Support for Default Settings #122

@pranavkonde

Description

@pranavkonde

Currently, many settings in Guppy need to be passed via command-line flags, which can be repetitive and cumbersome for users who frequently use the same settings. There's no way to persist user preferences or default configurations.

Problem

Users need to:

  • Repeatedly type the same flags for common operations
  • Remember various flag combinations for different scenarios
  • Manually set up the same configuration across different environments
  • Pass space DID and proof paths explicitly for each command

Proposed Solution

Add support for a configuration file (e.g., .guppy.yaml or .guppy.toml) that allows users to:

  1. Set default values for common flags
  2. Configure environment-specific settings
  3. Store frequently used space DIDs
  4. Define custom profiles for different use cases

Implementation Details

1. Configuration File Location

Primary locations (in order of precedence):

  • Current directory: ./.guppy.yaml
  • User's home directory: ~/.guppy/config.yaml
  • System-wide: /etc/guppy/config.yaml

2. Configuration Structure

# Example .guppy.yaml
default:
  space: "did:key:default_space_did"
  proof_path: "~/.guppy/proofs"
  json_output: false
  verbose: false

spaces:
  production:
    did: "did:key:prod_space_did"
    proof_path: "/path/to/prod/proofs"
  development:
    did: "did:key:dev_space_did"
    proof_path: "/path/to/dev/proofs"

upload:
  default_shard_size: 1073741824  # 1GB
  wrap_single_files: true
  include_hidden: false

profiles:
  prod:
    space: "production"
    verbose: true
    json_output: true
  dev:
    space: "development"
    verbose: true
    wrap_single_files: false

3. Command Line Integration

# Use specific profile
guppy --profile prod up file.txt

# Override config settings
guppy --space different:did up --no-wrap file.txt

4. Configuration Management Commands

Add new commands for managing configuration:

# Initialize config file
guppy config init

# Set a configuration value
guppy config set upload.default_shard_size 2GB

# Get a configuration value
guppy config get upload.default_shard_size

# List all settings
guppy config list

# Add a new profile
guppy config profile create dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions