@instafy/cli 0.1.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  # Instafy CLI (Preview)
4
4
 
5
- Run Instafy projects locally and connect them back to Instafy Studio — from any terminal.
5
+ Run Instafy spaces locally and connect them back to Instafy Studio — from any terminal.
6
6
 
7
7
  ## Quickstart
8
8
 
9
9
  0. Log in once: `instafy login`
10
10
  - Opens a Studio URL; the CLI continues automatically after you sign in.
11
11
  - Also enables Git auth (credential helper) for Instafy Git Service. Disable with `instafy login --no-git-setup`.
12
- - Multiple accounts: `instafy login --profile work` (then bind folders with `instafy project init --profile work` or `instafy project profile work`).
12
+ - Multiple accounts: `instafy login --profile work` (then bind folders with `instafy space init --profile work` or `instafy space profile work`).
13
13
  - Optional: set defaults with `instafy config set controller-url <url>` / `instafy config set studio-url <url>`
14
- 1. Link a folder to a project:
15
- - VS Code: install the Instafy extension and run `Instafy: Link Workspace to Project`, or
16
- - Terminal: `instafy project init`
14
+ 1. Link a folder to a space:
15
+ - VS Code: install the Instafy extension and run `Instafy: Link Workspace to Space`, or
16
+ - Terminal: `instafy space init`
17
17
  2. Start the runtime: `instafy runtime start`
18
18
  3. Check status / stop:
19
19
  - `instafy runtime status`
@@ -21,17 +21,84 @@ Run Instafy projects locally and connect them back to Instafy Studio — from an
21
21
 
22
22
  ## Common commands
23
23
 
24
- - `instafy runtime start` — start a local runtime (agent + origin).
24
+ - `instafy runtime start` — start a local runtime (agent + origin).
25
+ - A private local start receives a controller-assigned runtime/origin ID, registers without the hosted allocator, and requests its tunnel after registration with no runtime lease.
25
26
  - `instafy runtime status` — show health of the last started runtime.
26
- - `instafy runtime stop` — stop the last started runtime.
27
+ - `instafy runtime stop` — stop the last started runtime.
28
+ - `instafy space invite <email>` — invite a teammate to the linked space by email.
29
+ - Optional: `--role viewer|builder|admin|owner`
30
+ - `instafy space role <email> <role>` — update a teammate's access in the linked space by email.
31
+ - Works for existing members and pending invites.
32
+ - `builder` means read & write.
33
+ - Fallbacks: `--space <id>` or `--team-id <uuid>` when the folder is not linked yet
34
+ - `instafy conversation search "<keywords>"` — find earlier conversations in the linked space by title, preview, and recent message content.
35
+ - `instafy conversation show "<title-or-id>"` — inspect one conversation’s messages so you can reuse earlier context in a new chat.
36
+ - `instafy conversation create --parent <conversationId> --thread-kind agent --title "Octo coordination"` — create a linked child thread for conversation-native agent coordination.
37
+ - `instafy chat --conversation <threadId> "@octo ..." --no-wait` — involve another agent by posting a normal message into a normal conversation/thread. Use non-blocking posts from inside an active runtime turn.
38
+ - `instafy agents list` — list available top-level agents.
39
+ - `instafy agents context list --query "<topic>"` — inspect optional compact scoped context-card hints for cross-agent coordination.
40
+ - `instafy agents context put --agent @octo "<summary>"` — save/update a compact context card for the current conversation when `INSTAFY_CONVERSATION_ID` is set.
41
+ - Context cards are a bounded cache, not the primary collaboration path: the controller keeps the newest 200 cards per user/project/agent.
42
+ - Use context cards for soft work focus and overlap hints, not hard locks: note the agent/thread, topic/path/domain, open questions, and where follow-up should go. Structured `writeScope` metadata remains the safety mechanism for concurrent file edits.
27
43
  - `instafy git <args...>` — run git commands against an Instafy canonical checkout (`.instafy/.git`) when present.
28
- - `instafy tunnel start` — start a detached tunnel for a local port.
44
+ - `instafy tunnel start` — start a detached tunnel for a local port (sticky hostname by default; use `--rotate` to mint a new one).
29
45
  - `instafy tunnel list` — list local tunnels started by the CLI.
30
46
  - `instafy tunnel logs <tunnelId> --follow` — tail tunnel logs.
31
47
  - `instafy tunnel stop <tunnelId>` — stop + revoke a tunnel.
32
- - `instafy api get` — query controller endpoints (conversations, messages, runs, etc).
48
+ - `instafy secrets list` — list space secret metadata (names/descriptions, never values).
49
+ - `instafy secrets get <name-or-id>` — inspect one space secret metadata entry.
50
+ - `instafy secrets put <name> --value ...` — create/update a space secret.
51
+ - `instafy secrets revoke <name-or-id>` — revoke a space secret.
52
+ - `instafy support report "Runtime stops after launch"` — submit a support report as the
53
+ signed-in user.
54
+ - `instafy support list` — list only your own support reports.
55
+ - `instafy support show <reportId>` — inspect one of your own support reports.
56
+ - `instafy diagnostics runtime-events` — emit sanitized runtime events for the linked space as
57
+ versioned JSON.
58
+ - `instafy diagnostics run-result <runId>` — emit one authorized persisted run result as
59
+ versioned JSON.
60
+ - `instafy providers list` — list local providers exposed by the shared provider host surface.
61
+ - `instafy providers discover <providerId>` — run fresh discovery for one provider.
62
+ - `instafy providers read <providerId> <uri>` — inspect one provider resource.
63
+ - `instafy providers probe <providerId>` — run a transport probe against one provider.
33
64
 
34
- Run `instafy --help` for the full command list and options.
65
+ Run `instafy --help` for the public command list and options.
66
+
67
+ ## AI-readable diagnostics
68
+
69
+ `instafy diagnostics` is the machine-readable diagnostics surface for local agents such as Codex
70
+ or Claude Code. Successful commands print the `instafy-diagnostics-v1` JSON contract; failures
71
+ exit non-zero with empty stdout and a human-readable stderr message. They do not require a
72
+ dashboard and do not scrape process logs.
73
+
74
+ ```bash
75
+ instafy diagnostics runtime-events --space <spaceId> --limit 50
76
+ instafy diagnostics run-result <runId>
77
+ ```
78
+
79
+ These commands accept only signed-in user credentials. The controller applies normal space,
80
+ conversation, and private-runtime authorization and sanitizes stored runtime-event data. A
81
+ diagnostic read never creates or enriches a support report automatically; use `instafy support
82
+ report` explicitly when information should be sent to support.
83
+
84
+ For `run-result`, top-level `status: "ready"` means a persisted result is available, not that the
85
+ run succeeded. Inspect the nested result status or outcome before making that decision.
86
+
87
+ ## Support and operator boundary
88
+
89
+ `instafy support` is the customer-facing support surface. It requires a human user login (or an
90
+ explicit user access token), and the controller limits list/show operations to reports owned by
91
+ that user. Reports use the currently linked space by default; pass `--no-linked-space` to omit that
92
+ context. Diagnostics are opt-in: details, metadata, logs, and screenshots are uploaded only when
93
+ their corresponding flags are supplied, and file inputs must stay within the active workspace.
94
+ Use `--preview` to inspect the upload summary without sending a report.
95
+ Ordinary users receive a minimized owner-only report view; full triage fields and attachment bytes
96
+ require operator/service authorization.
97
+
98
+ Hosted Instafy operator access belongs in a separate, non-public `instafy-ops` distribution. It is
99
+ not part of this open-source package. The former `ops`, raw `api`, `ota`, and `desktop-updates`
100
+ command groups have been removed from the customer artifact. Saved login tokens are never
101
+ forwarded or refreshed to a different controller origin.
35
102
 
36
103
  ## Docs
37
104
 
package/bin/instafy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from "../dist/index.js";
2
+ import { runCli } from "../dist/cli.js";
3
3
 
4
4
  try {
5
5
  await runCli(process.argv);