Skip to content

Commit eada1aa

Browse files
feat: add 'instanode up' command + INSTANT_TOKEN env support (#1)
- cmd/up.go (new): provisions the full bundle (db/cache/nosql/queue/ storage/webhook) in one command and prints a deploy-ready .env to stdout. Mirrors the bundle-first product positioning. - cmd/monitor.go: provisionResponse gains ReceiveURL field so /webhook/new responses parse cleanly (webhook returns receive_url instead of connection_url). - cmd/root.go: INSTANT_TOKEN env var takes priority over the saved config from 'instanode login'. Lets CI / agents pass a token without a login step. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9f5e398 commit eada1aa

3 files changed

Lines changed: 380 additions & 2 deletions

File tree

cmd/monitor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ func makeProvisionCmd(endpoint, resourceType string) func(*cobra.Command, []stri
9191
}
9292

9393
// provisionResponse is the shape returned by POST /{service}/new endpoints.
94+
// /webhook/new returns receive_url instead of connection_url.
9495
type provisionResponse struct {
9596
OK bool `json:"ok"`
9697
Token string `json:"token"`
9798
Name string `json:"name"`
9899
ConnectionURL string `json:"connection_url"`
100+
ReceiveURL string `json:"receive_url"`
99101
Tier string `json:"tier"`
100102
Note string `json:"note"`
101103
Upgrade string `json:"upgrade"`

cmd/root.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ func initConfig() {
8282
}
8383

8484
// Wire up the auth transport — no-ops when unauthenticated.
85-
apiKey := ""
86-
if cfg != nil {
85+
// Priority: INSTANT_TOKEN env var > saved config (instant login).
86+
apiKey := os.Getenv("INSTANT_TOKEN")
87+
if apiKey == "" && cfg != nil {
8788
apiKey = cfg.APIKey
8889
}
8990
HTTPClient = &http.Client{

0 commit comments

Comments
 (0)