Skip to content

feat(configure): add project_id field to config#13

Merged
tvt286 merged 1 commit intomainfrom
feat/config-project-id
Apr 19, 2026
Merged

feat(configure): add project_id field to config#13
tvt286 merged 1 commit intomainfrom
feat/config-project-id

Conversation

@tvt286
Copy link
Copy Markdown
Contributor

@tvt286 tvt286 commented Apr 19, 2026

Summary

VNG Cloud APIs embed the user's project UUID in many URL paths (e.g. /v2/{projectId}/networks). Adding project_id to the CLI config lets downstream tools (greenode-mcp-server, future SDKs) read a cached value instead of calling /v1/projects every session.

  • Scope: per-profile field stored in ~/.greenode/config alongside region and output. Not a secret — lives in config, not credentials.
  • Resolution order: GRN_DEFAULT_PROJECT_ID env var > config file value > empty (downstream tool can auto-detect)

Changes

  • grn configure: wizard prompts for Project ID (blank = skip)
  • grn configure list: includes project_id with source column (env / config-file)
  • grn configure get project_id
  • grn configure set project_id <value>
  • GRN_DEFAULT_PROJECT_ID env var override
  • Profiles work as-is (each profile has its own project_id)
  • Docs updated (README, docs/configuration.md)

Test Plan

  • grn configure set project_id pro-xxx persists to ~/.greenode/config
  • grn configure get project_id returns value
  • grn configure list shows field + source (env vs config-file)
  • GRN_DEFAULT_PROJECT_ID override takes priority over file
  • go vet + go build clean
  • Setting empty value clears the field
  • Manual: wizard end-to-end with a fresh profile
  • Downstream: greenode-mcp-server reads this field (follow-up PR)

🤖 Generated with Claude Code

VNG Cloud APIs embed the user's project UUID in many URL paths. Adding
project_id to the CLI config lets downstream tools (greenode-mcp-server,
future SDKs) read a cached value instead of calling /v1/projects every
session.

Scope: per-profile field stored in ~/.greenode/config alongside region
and output. Not a secret — lives in config, not credentials.

- `grn configure`: wizard prompts for Project ID (blank = skip)
- `grn configure list`: includes project_id with source column
- `grn configure get project_id` / `set project_id <value>`
- `GRN_DEFAULT_PROJECT_ID` env var override
- Profiles work as-is (each profile has its own project_id)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tvt286 tvt286 merged commit 2179861 into main Apr 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant