dsh-agora 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.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -0
  3. package/assets/agora/SKILL.md +113 -0
  4. package/assets/agora/references/cli/README.md +161 -0
  5. package/assets/agora/references/cli/automation.md +189 -0
  6. package/assets/agora/references/cli/doctor.md +129 -0
  7. package/assets/agora/references/cli/env.md +158 -0
  8. package/assets/agora/references/cli/install-auth.md +152 -0
  9. package/assets/agora/references/cli/projects.md +116 -0
  10. package/assets/agora/references/cli/quickstarts.md +117 -0
  11. package/assets/agora/references/cloud-recording/README.md +86 -0
  12. package/assets/agora/references/conversational-ai/README.md +285 -0
  13. package/assets/agora/references/conversational-ai/agent-client-toolkit-react.md +182 -0
  14. package/assets/agora/references/conversational-ai/agent-samples.md +101 -0
  15. package/assets/agora/references/conversational-ai/agent-toolkit-android.md +209 -0
  16. package/assets/agora/references/conversational-ai/agent-toolkit-ios.md +208 -0
  17. package/assets/agora/references/conversational-ai/agent-toolkit.md +201 -0
  18. package/assets/agora/references/conversational-ai/agent-ui-kit.md +63 -0
  19. package/assets/agora/references/conversational-ai/architecture.md +221 -0
  20. package/assets/agora/references/conversational-ai/auth-flow.md +154 -0
  21. package/assets/agora/references/conversational-ai/conversational-ai-studio.md +173 -0
  22. package/assets/agora/references/conversational-ai/go-sdk.md +184 -0
  23. package/assets/agora/references/conversational-ai/integration-from-quickstart.md +203 -0
  24. package/assets/agora/references/conversational-ai/python-sdk.md +122 -0
  25. package/assets/agora/references/conversational-ai/quickstarts.md +710 -0
  26. package/assets/agora/references/conversational-ai/server-custom-llm.md +45 -0
  27. package/assets/agora/references/conversational-ai/server-mcp.md +40 -0
  28. package/assets/agora/references/conversational-ai/server-sdk-rename.md +78 -0
  29. package/assets/agora/references/conversational-ai/server-sdks.md +128 -0
  30. package/assets/agora/references/doc-fetching.md +67 -0
  31. package/assets/agora/references/integration-patterns.md +201 -0
  32. package/assets/agora/references/mcp-tools.md +49 -0
  33. package/assets/agora/references/rtc/README.md +104 -0
  34. package/assets/agora/references/rtc/android.md +344 -0
  35. package/assets/agora/references/rtc/cross-platform-coordination.md +61 -0
  36. package/assets/agora/references/rtc/flutter.md +282 -0
  37. package/assets/agora/references/rtc/ios.md +306 -0
  38. package/assets/agora/references/rtc/nextjs.md +87 -0
  39. package/assets/agora/references/rtc/react-native.md +266 -0
  40. package/assets/agora/references/rtc/react.md +186 -0
  41. package/assets/agora/references/rtc/web.md +506 -0
  42. package/assets/agora/references/rtm/README.md +80 -0
  43. package/assets/agora/references/rtm/android.md +277 -0
  44. package/assets/agora/references/rtm/ios.md +231 -0
  45. package/assets/agora/references/rtm/web.md +348 -0
  46. package/assets/agora/references/server/README.md +22 -0
  47. package/assets/agora/references/server/tokens.md +74 -0
  48. package/assets/agora/references/server-gateway/README.md +80 -0
  49. package/assets/agora/references/server-gateway/linux-cpp.md +251 -0
  50. package/assets/agora/references/testing-guidance/SKILL.md +65 -0
  51. package/assets/agora/references/testing-guidance/completeness-gate.md +28 -0
  52. package/assets/agora/references/testing-guidance/convoai-rest.md +83 -0
  53. package/assets/agora/references/testing-guidance/mobile-rtm-and-renewal.md +109 -0
  54. package/assets/agora/references/testing-guidance/rtc-android.md +70 -0
  55. package/assets/agora/references/testing-guidance/rtc-ios.md +73 -0
  56. package/assets/agora/references/testing-guidance/rtc-react.md +51 -0
  57. package/assets/agora/references/testing-guidance/rtc-web.md +94 -0
  58. package/cordis.patch.yml +5 -0
  59. package/index.js +53 -0
  60. package/package.json +49 -0
@@ -0,0 +1,129 @@
1
+ # Agora CLI Doctor
2
+
3
+ <!-- applies-from: v0.2.1 -->
4
+
5
+ Use this file when the user needs either local CLI install diagnostics (`agora doctor`) or project readiness diagnostics (`agora project doctor`).
6
+
7
+ Verified against Agora CLI `0.2.1`.
8
+
9
+ > **Agents:** run [CLI readiness](README.md#cli-readiness-agents) before doctor-driven recovery loops.
10
+
11
+ ## Purpose
12
+
13
+ `agora doctor` checks the local CLI install.
14
+
15
+ `agora project doctor` checks whether a project is control-plane ready for feature development from the CLI's point of view.
16
+
17
+ Use `agora doctor` first when the failure looks local to the workstation or shell. Use `agora project doctor` when auth works and the problem is project configuration or feature readiness.
18
+
19
+ ## Install Doctor
20
+
21
+ Top-level `agora doctor` is available in `0.2.0+`. For `0.1.7–0.1.x`, use the read-only version and PATH checks in [CLI readiness](README.md#cli-readiness-agents), then prefer upgrading to the verified `0.2.1` baseline before deeper diagnostics.
22
+
23
+ ```bash
24
+ agora doctor
25
+ agora doctor --json
26
+ agora doctor --quiet
27
+ ```
28
+
29
+ Verified `0.2.1` install-doctor checks include:
30
+
31
+ - binary path and PATH resolution
32
+ - installed version
33
+ - `AGORA_HOME` writability
34
+ - API and OAuth DNS/network reachability
35
+ - auth/session state
36
+ - known MCP host detection
37
+
38
+ Verified `0.2.1` install-doctor exit codes:
39
+
40
+ - `0`: healthy
41
+ - `1`: blocking install issues
42
+ - `2`: warnings
43
+ - `3`: auth or session issues
44
+
45
+ Common recovery paths:
46
+
47
+ - PATH issue: run the shell-specific command printed by `agora doctor`, or use `which -a agora` to find a shadowing old binary. Do not uninstall automatically; ask before removing a stale binary — see [README.md](README.md#cli-readiness-agents)
48
+ - CLI below `0.1.7` or config schema newer than the running binary: follow the curl-first upgrade path in [install-auth.md](install-auth.md#version-gate-and-upgrade)
49
+ - network or DNS issue: fix connectivity or proxy settings before retrying auth
50
+ - auth issue: run `agora login`
51
+
52
+ It verifies:
53
+
54
+ - logged-in session
55
+ - project resolution or current-project context
56
+ - feature readiness
57
+ - basic project configuration such as App ID presence
58
+ - in `--deep` mode, repo-local `.agora` metadata and quickstart env consistency checks where applicable
59
+
60
+ It does not replace the full Conversational AI quickstart, RTM runtime validation, or end-to-end sample validation.
61
+
62
+ ## Commands
63
+
64
+ ```bash
65
+ agora project doctor [project]
66
+ agora project doctor --json
67
+ agora project doctor --feature convoai
68
+ agora project doctor --feature rtc
69
+ agora project doctor --feature rtm
70
+ agora project doctor --deep
71
+ ```
72
+
73
+ ## Interpreting Results
74
+
75
+ Verified result states in `0.2.1`:
76
+
77
+ - `healthy`: project is ready from the CLI's current checks
78
+ - `warning`: partially ready, but not fully clean
79
+ - `not_ready`: blocking issues were found
80
+ - `auth_error`: not logged in or project context cannot be resolved
81
+
82
+ Exit behavior verified in `0.2.1`:
83
+
84
+ - healthy doctor run exits `0`
85
+ - blocking readiness issues exit `1`
86
+ - warning-only readiness issues exit `2`
87
+ - auth or session issues exit `3`
88
+
89
+ ## Common Recovery Commands
90
+
91
+ If doctor reports an auth problem:
92
+
93
+ ```bash
94
+ agora login
95
+ ```
96
+
97
+ If doctor cannot resolve the target project:
98
+
99
+ ```bash
100
+ agora project use <project>
101
+ ```
102
+
103
+ If doctor reports ConvoAI feature readiness issues:
104
+
105
+ ```bash
106
+ agora project feature enable convoai
107
+ ```
108
+
109
+ If RTM or a related capability was just enabled and the first run still fails, allow bounded wait/retry before concluding the project is still broken. Control-plane enablement may surface before the runtime service is actually usable.
110
+
111
+ ## Deep Mode
112
+
113
+ `--deep` is part of the verified CLI surface. It runs deeper repo-local checks for `.agora` metadata and quickstart env consistency where applicable.
114
+
115
+ Do not claim `--deep` proves RTC or RTM runtime connectivity. It remains a CLI readiness check.
116
+
117
+ ## First-Success Boundary
118
+
119
+ Treat doctor results as **control-plane readiness only**:
120
+
121
+ - `healthy` / `warning` can mean the project is configured correctly at the CLI layer
122
+ - they do **not** prove RTM is already usable
123
+ - they do **not** prove the official sample can start, open, survive `Try it now`, and complete a conversation
124
+
125
+ ## Fix Mode
126
+
127
+ `--fix` is not in the verified command surface. Do not claim broad automatic remediation behavior unless a future CLI version documents it.
128
+
129
+ For safe guidance, prefer explicit remediation commands over "the CLI will fix this automatically."
@@ -0,0 +1,158 @@
1
+ # Agora CLI Project Environment Export
2
+
3
+ <!-- applies-from: v0.2.1 -->
4
+
5
+ Use this file when the user needs to export project credentials, write dotenv files, or explain the difference between generic project env and quickstart env commands.
6
+
7
+ Verified against Agora CLI `0.2.1`.
8
+
9
+ > **Agents:** complete [CLI readiness](README.md#cli-readiness-agents) first. For official quickstarts, **`quickstart env write` is mandatory** — see warning below.
10
+
11
+ `agora project env` is the CLI's primary generic project-environment export command. Official quickstart repos have a separate template-aware writer: `agora quickstart env write`.
12
+
13
+ ## Critical Agent Rule
14
+
15
+ Using `agora project env write` on an official Python or Go quickstart writes **`AGORA_APP_ID`** to a generic dotenv path. Those samples read **`APP_ID`** from `server/.env` or `server-go/.env`. The backend starts with empty credentials.
16
+
17
+ For official quickstarts, always use:
18
+
19
+ ```bash
20
+ agora quickstart env write [repo-path]
21
+ ```
22
+
23
+ Use:
24
+
25
+ ```bash
26
+ agora project env
27
+ ```
28
+
29
+ when the user wants project env vars.
30
+
31
+ Use:
32
+
33
+ ```bash
34
+ agora project env write [path]
35
+ ```
36
+
37
+ when they explicitly want generic Agora App ID / App Certificate values materialized into a dotenv file.
38
+
39
+ Use:
40
+
41
+ ```bash
42
+ agora quickstart env write [repo-path]
43
+ ```
44
+
45
+ when working inside an official quickstart or writing template-specific env names such as `NEXT_PUBLIC_AGORA_APP_ID` or `APP_ID`.
46
+
47
+ ## Export Commands
48
+
49
+ Default behavior:
50
+
51
+ ```bash
52
+ agora project env
53
+ ```
54
+
55
+ This prints non-sensitive dotenv lines to `stdout`. It does not write a file.
56
+
57
+ Other supported forms:
58
+
59
+ ```bash
60
+ agora project env --shell
61
+ agora project env --json
62
+ agora project env --format dotenv
63
+ agora project env --format shell
64
+ agora project env --format envelope
65
+ agora project env --format json
66
+ agora project env --project <project>
67
+ agora project env --with-secrets
68
+ ```
69
+
70
+ Use cases:
71
+
72
+ - default dotenv output: paste into `.env`, redirect to a file, or inspect values
73
+ - `--shell`: `source <(agora project env --format shell)`
74
+ - `--json` or `--format envelope`: agents, CI, or scripts using the unified JSON envelope
75
+ - `--project <project>`: export a non-current project without changing local context
76
+ - `--with-secrets`: include sensitive values such as the app certificate
77
+
78
+ Option rules:
79
+
80
+ - `--format shell` and `--shell` are equivalent output choices; use one or the other
81
+ - `--format` and `--shell` cannot be combined
82
+ - `--json` and `--shell` cannot be combined
83
+ - invalid `--format` values fail with: `` `--format` must be one of: dotenv, shell, envelope, json ``
84
+
85
+ ## Project Env Variables
86
+
87
+ The verified `0.2.1` project env export contract focuses on:
88
+
89
+ - `AGORA_APP_ID`
90
+ - `AGORA_APP_CERTIFICATE` only when `--with-secrets` is provided
91
+
92
+ Do not invent alternate names for the CLI env contract. If an agent needs project metadata beyond credentials, use `agora project show --json`.
93
+
94
+ ## Secrets Rule
95
+
96
+ Secrets are opt-in.
97
+
98
+ - By default, `agora project env` exports only non-sensitive development config.
99
+ - `AGORA_APP_CERTIFICATE` is emitted only with `--with-secrets`.
100
+ - If the target project does not have an app certificate, `--with-secrets` fails instead of silently emitting an empty value.
101
+
102
+ ## Generic Project Env Writing
103
+
104
+ `agora project env write [path]` writes generic `AGORA_APP_ID` and `AGORA_APP_CERTIFICATE` values to a dotenv file. If the selected project has no App Certificate, env writing cannot seed a token-ready app.
105
+
106
+ Supported flags:
107
+
108
+ ```bash
109
+ agora project env write
110
+ agora project env write apps/web/.env.local
111
+ agora project env write --append
112
+ agora project env write --overwrite
113
+ agora project env write .env.local --template nextjs
114
+ ```
115
+
116
+ Write rules:
117
+
118
+ - explicit `path`: write exactly that target path
119
+ - no `path`: choose the best default `.env*` target based on the current project directory
120
+ - `--append`: append App ID and App Certificate values when no existing values are present
121
+ - `--overwrite`: replace the target file with only Agora App ID and App Certificate values
122
+ - `--template nextjs|standard`: override the workspace detector when the credential key layout must be forced
123
+ - do not combine `--append` and `--overwrite`
124
+
125
+ Ask for explicit approval before running `--overwrite`, and state the target path before writing. Prefer append/update behavior for existing env files.
126
+
127
+ Do not use template files such as `.env.example`, `.env.sample`, or `.env.template` as write targets for real values or secrets.
128
+
129
+ In `0.2.1`, `project env write` updates or creates repo-local `.agora/project.json` metadata and records detected `projectType` / `envPath` when missing.
130
+
131
+ ## Quickstart Env Writing
132
+
133
+ Official quickstarts use template-specific env names and file paths. Use [quickstarts.md](quickstarts.md) for the full flow.
134
+
135
+ Verified `0.2.1` examples:
136
+
137
+ ```bash
138
+ agora quickstart env write my-python-demo --project my-project
139
+ agora quickstart env write /abs/path/to/my-go-demo --json
140
+ ```
141
+
142
+ Template-specific behavior:
143
+
144
+ | Template | Target | Variables |
145
+ |---|---|---|
146
+ | Next.js quickstart | `.env.local` | `NEXT_PUBLIC_AGORA_APP_ID`, `NEXT_AGORA_APP_CERTIFICATE` |
147
+ | Python quickstart | `server/.env` | `APP_ID`, `APP_CERTIFICATE` |
148
+ | Go quickstart | `server-go/.env` | `APP_ID`, `APP_CERTIFICATE` |
149
+
150
+ Existing env files are preserved. The CLI updates existing credential keys, appends missing values, and comments duplicate or stale Agora credential aliases for the selected runtime.
151
+
152
+ ## Agent Guidance
153
+
154
+ - For raw env consumption, prefer `agora project env --json` over `agora project show --json`.
155
+ - For shell sessions, prefer `agora project env --format shell`.
156
+ - For generic repo setup, use `agora project env write`.
157
+ - For official quickstart repos, use `agora quickstart env write` so the correct file path and variable names are used.
158
+ - `project env` prints the selected format directly; `project env write` and `quickstart env write` are action commands and can be consumed with `--json`.
@@ -0,0 +1,152 @@
1
+ # Agora CLI Install and Auth
2
+
3
+ <!-- applies-from: v0.2.1 -->
4
+
5
+ Use this file when the user needs to install the Agora CLI, authenticate, or verify that the local install is healthy.
6
+
7
+ Verified against Agora CLI `0.2.1`.
8
+
9
+ > **Agents:** start with the read-only **CLI readiness** probe in [README.md](README.md). Installers and global npm installs are allowed only as readiness remediation after user approval. That section is the single source of truth for version gates, curl-first upgrade, PATH recovery, and config mismatch errors.
10
+
11
+ ## Install
12
+
13
+ Ask for user approval before running installers, global package installs, shell-profile updates, or package removal commands.
14
+
15
+ ## Version Gate and Upgrade
16
+
17
+ Use [README.md](README.md#cli-readiness-agents) as the canonical agent readiness flow.
18
+
19
+ - Read-only probe first: `agora version` and `which -a agora` / `where.exe agora`.
20
+ - If `agora` is missing or below `0.1.7`, stop normal CLI workflow and upgrade. Do not call `agora upgrade` on `0.1.6`; it does not exist there.
21
+ - Preferred remediation after approval: `curl -fsSL https://raw.githubusercontent.com/AgoraIO/cli/main/install.sh | sh`.
22
+ - Alternate remediation after approval: `npm install -g agoraio-cli` when Node.js 18+ is available.
23
+ - If a direct-installer upgrade from `0.1.7`–`0.2.0` fails crossing `0.2.1`, re-run the curl installer once because release archive names changed.
24
+ - If `agora version` still reports an old version after install, check PATH shadowing with `which -a agora` / `where.exe agora` and follow `agora doctor`'s shell-specific PATH fix when available. Do not uninstall automatically; remove an old binary only after user approval, using `install.sh --uninstall` / `install.ps1 -Uninstall` for installer-managed installs when applicable.
25
+ - If the CLI errors with `Config version N is newer than this CLI supports`, an old binary is usually reading config from a newer CLI. Upgrade through the readiness flow; edit config only as a last resort after backing it up.
26
+
27
+ Preferred macOS / Linux / POSIX shell installer:
28
+
29
+ ```bash
30
+ curl -fsSL https://raw.githubusercontent.com/AgoraIO/cli/main/install.sh | sh
31
+ ```
32
+
33
+ Windows PowerShell installer:
34
+
35
+ ```powershell
36
+ irm https://raw.githubusercontent.com/AgoraIO/cli/main/install.ps1 | iex
37
+ ```
38
+
39
+ npm install path:
40
+
41
+ ```bash
42
+ npm install -g agoraio-cli
43
+ ```
44
+
45
+ The npm package is expected to be a thin install wrapper for the same Go-based `agora` binary. It requires Node.js 18+ when used. Do not describe npm as a permanent separate CLI implementation.
46
+
47
+ In `0.2.1`, the shell installers add the binary directory to `PATH` and wire shell completion by default. Use `--no-path`, `--no-completion`, or `--skip-shell` only when the user explicitly wants to opt out.
48
+
49
+ The installed command is:
50
+
51
+ ```bash
52
+ agora --help
53
+ agora version
54
+ agora doctor --json
55
+ ```
56
+
57
+ If the user still has the deprecated preview package:
58
+
59
+ ```bash
60
+ npm uninstall -g agora-cli-preview
61
+ npm install -g agoraio-cli
62
+ ```
63
+
64
+ For pinned versions, uninstall, custom install directories, Windows details, npm details, or source builds, use the upstream install docs in <https://github.com/AgoraIO/cli>.
65
+
66
+ > ⚠️ Removed in v0.2.0: `curl -fsSL https://raw.githubusercontent.com/AgoraIO/cli/main/install.sh | sh -s -- --add-to-path`. Use `curl -fsSL https://raw.githubusercontent.com/AgoraIO/cli/main/install.sh | sh` instead.
67
+
68
+ ## Login Flow
69
+
70
+ Primary commands:
71
+
72
+ ```bash
73
+ agora login
74
+ agora login --no-browser
75
+ agora whoami
76
+ agora logout
77
+ ```
78
+
79
+ Equivalent auth-group commands:
80
+
81
+ ```bash
82
+ agora auth login
83
+ agora auth status
84
+ agora auth status --json
85
+ agora auth logout
86
+ ```
87
+
88
+ `agora login` starts an OAuth browser flow and stores a local session.
89
+
90
+ If browser auto-open fails, use `agora login --no-browser` so the CLI prints a URL and the user can open it manually.
91
+
92
+ For agents, use `agora auth status --json`. In `0.2.1`, unauthenticated status is still a recoverable auth state; the JSON error envelope uses exit code `3` with `AUTH_UNAUTHENTICATED`.
93
+
94
+ ## Verification and Failure Modes
95
+
96
+ Run the install self-test before debugging higher-level project issues:
97
+
98
+ ```bash
99
+ agora doctor
100
+ agora doctor --json
101
+ ```
102
+
103
+ Observed `0.2.1` exit codes:
104
+
105
+ - `0`: healthy install
106
+ - `1`: blocking install issues
107
+ - `2`: warnings
108
+ - `3`: auth or session issues
109
+
110
+ Common failures:
111
+
112
+ - If `agora doctor` reports PATH issues, follow the command it prints for the current shell.
113
+ - If `agora doctor` reports DNS or network failures, fix network or proxy settings before retrying `agora login`.
114
+ - If `agora login` is run in JSON, CI, or non-TTY mode without an existing session, `-y` / `--yes` does not start a new browser flow; the command fails fast with `AUTH_UNAUTHENTICATED`.
115
+ - If upgrade from a direct installer fails when crossing 0.2.1, re-run the curl installer once — see [README.md](README.md) CLI readiness.
116
+
117
+ ## OAuth Loopback Rule
118
+
119
+ The verified `0.2.0` loopback login flow advertises a redirect URI shaped like:
120
+
121
+ ```text
122
+ http://localhost:<port>/oauth/callback
123
+ ```
124
+
125
+ Important rule:
126
+
127
+ - the `redirect_uri` sent to authorize and token exchange must match exactly
128
+ - treat `localhost` and `127.0.0.1` as different strings for OAuth validation
129
+
130
+ If the user reports a `redirect_uri mismatch` or a browser login that gets a `400` during token exchange, tell them to check for any local tooling or overrides that switch one step to `127.0.0.1` while the other still uses `localhost`.
131
+
132
+ ## Config and Session Location
133
+
134
+ The CLI stores config, session, logs, and current-project context under the Agora CLI config directory.
135
+
136
+ - macOS default: `~/.agora-cli`
137
+ - Linux default: `$XDG_CONFIG_HOME/agora-cli` or `~/.config/agora-cli`
138
+ - local override for testing or isolation: `AGORA_HOME=/custom/path`
139
+
140
+ ## What to Tell the User
141
+
142
+ - If they are not logged in, tell them to run `agora login` first.
143
+ - If they ask "am I logged in?", use `agora whoami`, `agora whoami --plain`, or `agora auth status --json`.
144
+ - If they ask which environment overrides exist, use `agora env-help --json`.
145
+ - If they want a noninteractive or isolated local setup, route to [automation.md](automation.md).
146
+
147
+ ## Things Not to Overstate
148
+
149
+ - Do not promise headless service-account auth; the verified flow is browser-based OAuth.
150
+ - Do not document `--add-to-path`; it was removed in `0.2.0`.
151
+ - Do not claim the preview package is still the recommended install target.
152
+ - Use `agora` for an installed CLI. Use `./agora` only when running a local binary built from the CLI repository.
@@ -0,0 +1,116 @@
1
+ # Agora CLI Projects
2
+
3
+ <!-- applies-from: v0.2.1 -->
4
+
5
+ Use this file when the user needs to create, select, inspect, or feature-enable Agora projects from the CLI.
6
+
7
+ Verified against Agora CLI `0.2.1`.
8
+
9
+ ## Core Workflow
10
+
11
+ Use `agora init` for the fastest end-to-end demo setup. Use low-level project commands when the workflow must be decomposed:
12
+
13
+ ```bash
14
+ agora login
15
+ agora project create my-agent-demo --feature rtc --feature rtm --feature convoai
16
+ agora project use my-agent-demo
17
+ agora project env
18
+ agora project feature list
19
+ agora project list --refresh-cache
20
+ ```
21
+
22
+ ## Project Commands
23
+
24
+ ### Create
25
+
26
+ ```bash
27
+ agora project create <name> [--region global|cn] [--template voice-agent] [--feature rtc|rtm|convoai]
28
+ agora project create <name> --dry-run
29
+ agora project create <name> --idempotency-key <key>
30
+ agora project create <name> --rtm-data-center EU
31
+ ```
32
+
33
+ For agent guidance, prefer explicit `--feature` flags because they match the later `project feature` workflow. Omitted `--feature` defaults to `rtc`, `rtm`, and `convoai`, and `convoai` implies `rtm`.
34
+
35
+ ### List
36
+
37
+ ```bash
38
+ agora project list [--page N] [--page-size N] [--keyword <text>]
39
+ agora project list --refresh-cache
40
+ ```
41
+
42
+ Use this when the user needs to discover a project ID or exact project name.
43
+
44
+ `--refresh-cache` updates the unfiltered first-page cache the CLI uses for shell completion. That matters when the user's completion results lag behind recent project changes.
45
+
46
+ ### Select Current Project
47
+
48
+ ```bash
49
+ agora project use <project>
50
+ ```
51
+
52
+ `<project>` can be a project ID or exact project name.
53
+
54
+ After `project use`, commands like `project show`, `project feature list`, and `project doctor` can run without repeating the project argument.
55
+
56
+ ### Show One Project
57
+
58
+ ```bash
59
+ agora project show [project]
60
+ agora project show --json
61
+ ```
62
+
63
+ This is the quickest way to inspect App ID, App Certificate, region, sign key, and token-enabled status for the current project.
64
+
65
+ Use `project show --json` for project metadata inspection.
66
+
67
+ If the user wants exported env vars or a dotenv workflow, route to [env.md](env.md) and use:
68
+
69
+ ```bash
70
+ agora project env
71
+ agora project env --json
72
+ agora project env write
73
+ ```
74
+
75
+ ## Feature Commands
76
+
77
+ Valid verified feature names:
78
+
79
+ - `rtc`
80
+ - `rtm`
81
+ - `convoai`
82
+
83
+ Commands:
84
+
85
+ ```bash
86
+ agora project feature list [project]
87
+ agora project feature status <feature> [project]
88
+ agora project feature enable <feature> [project]
89
+ ```
90
+
91
+ Most ConvoAI onboarding preparation starts with:
92
+
93
+ ```bash
94
+ agora project feature enable convoai
95
+ ```
96
+
97
+ ## Current-Project Context
98
+
99
+ If the user omits `[project]`, the CLI uses the locally selected project context.
100
+
101
+ In a bound quickstart repo, project resolution prefers repo-local `.agora/project.json` before global `agora project use` context. See [quickstarts.md](quickstarts.md) for the full precedence.
102
+
103
+ If no project is selected, the verified recovery is:
104
+
105
+ ```bash
106
+ agora project use <project>
107
+ ```
108
+
109
+ or rerun the command with a project argument.
110
+
111
+ ## Things Not to Hallucinate
112
+
113
+ - Do not invent `agora project delete`.
114
+ - Do not invent `agora project feature disable`.
115
+ - Do not invent ConvoAI-specific nested groups under `agora project`.
116
+ - Do not invent `agora project doctor all`; use `agora project doctor --feature convoai`, `--feature rtc`, or `--feature rtm`.
@@ -0,0 +1,117 @@
1
+ # Agora CLI Init and Quickstarts
2
+
3
+ <!-- applies-from: v0.2.1 -->
4
+
5
+ Use this file when the user wants `agora init`, `agora quickstart ...`, or repo-local project binding for an official quickstart.
6
+
7
+ Verified against Agora CLI `0.2.1`.
8
+
9
+ > **Agents:** complete [CLI readiness](README.md#cli-readiness-agents) in [README.md](README.md) before any command here.
10
+
11
+ ## Core Decision
12
+
13
+ Use:
14
+
15
+ ```bash
16
+ agora init <name> --template <template>
17
+ ```
18
+
19
+ when the user wants a new runnable demo with project binding and env writing handled by the CLI.
20
+
21
+ Use:
22
+
23
+ ```bash
24
+ agora quickstart create <name> --template <template> --project <project>
25
+ agora quickstart env write <path-or-repo> --project <project>
26
+ ```
27
+
28
+ when the user wants to clone or re-bind an official quickstart separately from project creation.
29
+
30
+ Use low-level `agora project ...` commands when the workflow must be decomposed, resumed, or inspected step by step.
31
+
32
+ ## Commands
33
+
34
+ ```bash
35
+ agora init my-nextjs-demo --template nextjs
36
+ agora init my-python-demo --template python
37
+ agora init my-go-demo --template go
38
+ agora init my-demo --template python --project my-existing-project
39
+ agora init my-demo --template python --new-project
40
+ agora init my-rtm-demo --template nextjs --new-project --feature rtc --feature rtm --rtm-data-center AP
41
+ agora init my-app --template nextjs --add-agent-rules cursor
42
+ ```
43
+
44
+ Agent-safe non-interactive example:
45
+
46
+ ```bash
47
+ agora init my-python-demo --template python --new-project --json
48
+ ```
49
+
50
+ `agora init` creates or binds an Agora project, clones the selected quickstart, writes its env file, persists repo-local project context, and prints next steps. Newly created projects default to `rtc`, `rtm`, and `convoai`; `convoai` also implies `rtm`.
51
+
52
+ In `--json`, `--yes`, CI, or non-TTY runs, **`--template` is required**. Without it the CLI fails fast with `QUICKSTART_TEMPLATE_REQUIRED`. Do not run bare `agora init <name>` in agent terminals — interactive template prompts cannot be answered there.
53
+
54
+ ```bash
55
+ agora quickstart list
56
+ agora quickstart list --details
57
+ agora quickstart list --show-all
58
+ agora quickstart create my-python-demo --template python --project my-project
59
+ agora quickstart env write my-python-demo --project my-project
60
+ agora quickstart env write /abs/path/to/my-python-demo --json
61
+ ```
62
+
63
+ `quickstart create` shells out to `git clone`. Clone subprocesses disable git credential helpers so agent and CI runs do not hang on macOS keychain prompts.
64
+
65
+ Typed clone failures:
66
+
67
+ | Code | Recovery |
68
+ |------|----------|
69
+ | `QUICKSTART_GIT_MISSING` | Install `git` and retry |
70
+ | `QUICKSTART_REF_INVALID` | Pass a valid `--ref` (no leading `-`) |
71
+ | `QUICKSTART_REPO_OVERRIDE_INVALID` | Fix or unset `AGORA_QUICKSTART_<TEMPLATE>_REPO_URL` |
72
+
73
+ > ⚠️ Removed in v0.2.0: `agora quickstart list --verbose`. Use `agora quickstart list --details` instead.
74
+
75
+ ## Project Binding
76
+
77
+ The CLI writes repo-local non-secret project metadata to:
78
+
79
+ ```text
80
+ .agora/project.json
81
+ ```
82
+
83
+ Resolution order:
84
+
85
+ 1. explicit `--project` or positional project argument
86
+ 2. repo-local `.agora/project.json` resolved from the target repo path
87
+ 3. global context set by `agora project use`
88
+
89
+ `.agora/project.json` can include durable metadata such as project ID, project name, region, template, env path, and detected `projectType`. Do not put secrets in this file.
90
+
91
+ ## Env Writing
92
+
93
+ `quickstart env write` is template-aware. It writes the variable names and env file path the selected official quickstart expects:
94
+
95
+ | Template | Target | Variables |
96
+ |---|---|---|
97
+ | Generic project env | selected dotenv file | `AGORA_APP_ID`, `AGORA_APP_CERTIFICATE` |
98
+ | Next.js quickstart | `.env.local` | `NEXT_PUBLIC_AGORA_APP_ID`, `NEXT_AGORA_APP_CERTIFICATE` |
99
+ | Python quickstart | `server/.env` | `APP_ID`, `APP_CERTIFICATE` |
100
+ | Go quickstart | `server-go/.env` | `APP_ID`, `APP_CERTIFICATE` |
101
+
102
+ **Agent rule:** for official quickstarts, always use **`agora quickstart env write`**, not `agora project env write`. Using the generic writer leaves Python samples with `AGORA_APP_ID` while the backend reads `APP_ID` — the service starts but credentials are empty.
103
+
104
+ Existing `.env` and `.env.local` files are preserved. The CLI updates existing credential keys, appends missing credentials, and comments duplicate or stale Agora credential aliases for the selected runtime.
105
+
106
+ Use [env.md](env.md) for generic `agora project env` and `agora project env write` behavior.
107
+
108
+ ## Agent Guidance
109
+
110
+ - Complete [CLI readiness](README.md#cli-readiness-agents) before `init` or env writes.
111
+ - Prefer `agora init <name> --template <template> --json` for one-shot onboarding.
112
+ - Always pass `--template` in agent, CI, and `--json` runs.
113
+ - Prefer `agora quickstart env write ... --json` when seeding or re-syncing official quickstart repos.
114
+ - Do not substitute manual `git clone` until `init` / `quickstart create` fails with a documented error code and recovery is exhausted.
115
+ - Use `agora project doctor --json` after binding to check control-plane readiness, but do not treat it as proof that the sample can run end to end.
116
+ - Use `agora doctor --json` when available (`0.2.0+`) and the failure looks local to the CLI install rather than to the project.
117
+ - Use `agora` in user-facing commands for an installed CLI. Use `./agora` only when running a local binary built from the CLI repository.