Add CLI config file management #4

Open
opened 2026-03-16 21:14:03 +00:00 by austin · 0 comments
Owner

The CLI needs to know which server to talk to and what token to use. This is the foundation for all CLI commands.

What needs to happen

Create config management (e.g., internal/cli/config.go) that reads/writes ~/.config/vektor/config.json with fields:

  • server_url — the Vektor server URL
  • token — the API token from vektor login

Add a vektor config set-server <url> command.

Respect environment variable overrides:

  • VEKTOR_SERVER overrides server_url
  • VEKTOR_TOKEN overrides token

Use os.UserConfigDir() for cross-platform config directory resolution. This is straightforward file I/O and JSON marshaling — a good early Go exercise.

The CLI needs to know which server to talk to and what token to use. This is the foundation for all CLI commands. ## What needs to happen Create config management (e.g., `internal/cli/config.go`) that reads/writes `~/.config/vektor/config.json` with fields: - `server_url` — the Vektor server URL - `token` — the API token from `vektor login` Add a `vektor config set-server <url>` command. Respect environment variable overrides: - `VEKTOR_SERVER` overrides `server_url` - `VEKTOR_TOKEN` overrides `token` Use `os.UserConfigDir()` for cross-platform config directory resolution. This is straightforward file I/O and JSON marshaling — a good early Go exercise.
austin added this to the CLI Core milestone 2026-03-16 21:14:03 +00:00
austin self-assigned this 2026-03-16 21:14:03 +00:00
austin added this to the Vektor - CLI project 2026-03-16 21:14:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
austin/vektor#4
No description provided.