@agendapanda/cli 0.3.2 → 0.4.1

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 (45) hide show
  1. package/README.md +110 -87
  2. package/dist/bin/ap.js +32 -0
  3. package/dist/bin/ap.js.map +1 -1
  4. package/dist/src/commands/alias.d.ts +2 -0
  5. package/dist/src/commands/alias.js +84 -0
  6. package/dist/src/commands/alias.js.map +1 -0
  7. package/dist/src/commands/auth.d.ts +4 -0
  8. package/dist/src/commands/auth.js +224 -20
  9. package/dist/src/commands/auth.js.map +1 -1
  10. package/dist/src/commands/calendar.js +8 -3
  11. package/dist/src/commands/calendar.js.map +1 -1
  12. package/dist/src/commands/completion.d.ts +2 -0
  13. package/dist/src/commands/completion.js +197 -0
  14. package/dist/src/commands/completion.js.map +1 -0
  15. package/dist/src/commands/connections.js +171 -26
  16. package/dist/src/commands/connections.js.map +1 -1
  17. package/dist/src/commands/context.js +10 -2
  18. package/dist/src/commands/context.js.map +1 -1
  19. package/dist/src/commands/init.d.ts +2 -0
  20. package/dist/src/commands/init.js +249 -0
  21. package/dist/src/commands/init.js.map +1 -0
  22. package/dist/src/commands/post.js +253 -9
  23. package/dist/src/commands/post.js.map +1 -1
  24. package/dist/src/commands/projects.js +8 -2
  25. package/dist/src/commands/projects.js.map +1 -1
  26. package/dist/src/index.js +24 -2
  27. package/dist/src/index.js.map +1 -1
  28. package/dist/src/lib/config.d.ts +18 -0
  29. package/dist/src/lib/config.js +48 -0
  30. package/dist/src/lib/config.js.map +1 -1
  31. package/dist/src/lib/errors.d.ts +4 -0
  32. package/dist/src/lib/errors.js +5 -0
  33. package/dist/src/lib/errors.js.map +1 -0
  34. package/dist/src/lib/platform-rules.js +2 -0
  35. package/dist/src/lib/platform-rules.js.map +1 -1
  36. package/dist/src/lib/poll.d.ts +11 -0
  37. package/dist/src/lib/poll.js +42 -0
  38. package/dist/src/lib/poll.js.map +1 -0
  39. package/dist/src/lib/update-check.d.ts +2 -0
  40. package/dist/src/lib/update-check.js +66 -0
  41. package/dist/src/lib/update-check.js.map +1 -0
  42. package/dist/src/lib/utils.d.ts +2 -0
  43. package/dist/src/lib/utils.js +27 -0
  44. package/dist/src/lib/utils.js.map +1 -0
  45. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  CLI for [Agenda Panda](https://agendapanda.com) — schedule and manage social media posts from the terminal.
4
4
 
5
- Works with X (Twitter), LinkedIn, Facebook Pages, Instagram, and Threads.
5
+ Works with X (Twitter), LinkedIn, Facebook Pages, Instagram, Threads, Bluesky, and TikTok.
6
6
 
7
7
  ## Install
8
8
 
@@ -18,80 +18,114 @@ npx @agendapanda/cli <command>
18
18
 
19
19
  ## Quick start
20
20
 
21
+ **New user? Run the setup wizard:**
22
+
23
+ ```bash
24
+ ap init
25
+ ```
26
+
27
+ `ap init` walks you through authentication, workspace selection, connecting your first platform (with OAuth polling), and optionally sending a test post.
28
+
29
+ **Manual setup (for scripting / CI):**
30
+
21
31
  ```bash
22
- # 1. Create an API key at https://agendapanda.com/account-settings
23
- # 2. Authenticate
24
- ap auth login --key ap_your_key_here
32
+ # Authenticate opens API key settings page in browser, then prompts for key
33
+ ap auth login --browser
25
34
 
26
- # 3. Set active workspace
35
+ # Or pass the key directly
36
+ ap auth login --key "ap_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
37
+
38
+ # Check who you are
39
+ ap whoami
40
+
41
+ # Select a workspace
27
42
  ap projects list
28
43
  ap projects use <project-id>
29
44
 
30
- # 4. Post something
31
- ap post create --content "Hello world" --connection <connection-id> --now
32
- ```
45
+ # Connect a platform (opens browser, waits for OAuth to complete)
46
+ ap connections add x --open
47
+ ap connections add tiktok --open
33
48
 
34
- ## Commands
49
+ # Set a default connection so you don't need --connection on every post
50
+ ap connections use <connection-id>
35
51
 
36
- ### Authentication
52
+ # Post immediately
53
+ ap post create --content "Hello from Agenda Panda CLI" --now
37
54
 
38
- ```
39
- ap auth login --key <key> Store API key (or set AP_API_KEY env var)
40
- ap auth logout Clear stored credentials
41
- ap auth status Show current user and active project
42
- ap auth api-keys list List API keys
43
- ap auth api-keys create --name Create a new API key
44
- ap auth api-keys revoke <id> Revoke an API key
45
- ```
55
+ # Or just run interactively — no flags needed
56
+ ap post create
46
57
 
47
- ### Workspaces
58
+ # Schedule a post
59
+ ap post create --content "Scheduled post" --schedule "2026-03-01T14:00:00Z"
48
60
 
49
- ```
50
- ap projects list List workspaces
51
- ap projects use <id> Set active workspace
52
- ap projects get Show full workspace details
53
- ap projects update Update workspace settings
61
+ # AI-powered content (pipe context into your AI tool)
62
+ ap context | claude "Write 5 posts for this week"
54
63
  ```
55
64
 
56
- `ap projects update` accepts `--name`, `--website`, `--industry`, `--target-audience`, `--brand-voice`, `--timezone`, `--soul-file <path>`, `--art-file <path>`, `--clear-soul`, `--clear-art`.
65
+ ## Commands Reference
57
66
 
58
- ### Connections
67
+ | Command | Description |
68
+ |---------|-------------|
69
+ | `ap init` | Guided first-run setup wizard |
70
+ | `ap whoami` | Show current user and active workspace |
71
+ | `ap auth login [--browser] [--key]` | Authenticate with an API key |
72
+ | `ap auth switch` | Switch between saved API key profiles |
73
+ | `ap auth switch --add --name <n> --key <k>` | Save a new profile |
74
+ | `ap auth switch --delete --name <n>` | Delete a saved profile |
75
+ | `ap auth logout` | Clear stored credentials |
76
+ | `ap auth api-keys list\|create\|revoke` | Manage API keys |
77
+ | `ap projects list\|use\|get\|update` | Manage workspaces |
78
+ | `ap connections list` | List connected social accounts |
79
+ | `ap connections add <platform> --open` | Connect a platform via OAuth |
80
+ | `ap connections use <id>` | Set a default connection for posting |
81
+ | `ap connections clear` | Unset the default connection |
82
+ | `ap connections health [--watch]` | Check connection health (live with `--watch`) |
83
+ | `ap post create [options]` | Create a post (interactive if no flags) |
84
+ | `ap post list\|get\|delete\|retry\|update` | Manage posts |
85
+ | `ap alias set\|list\|delete` | Manage command aliases |
86
+ | `ap calendar import\|sync\|pull` | Bulk content calendar operations |
87
+ | `ap context [--json] [--verbose]` | Dump brand context for AI tools |
88
+ | `ap media upload <file>` | Upload an image or video |
89
+ | `ap completion bash\|zsh\|fish` | Generate shell completion scripts |
59
90
 
60
- ```
61
- ap connections list List connected social accounts
62
- ap connections health Check connection health status
63
- ap connections add <platform> Start OAuth flow (twitter, linkedin, facebook, threads, instagram)
64
- ap connections add-all Start OAuth flow for all platforms
65
- ```
91
+ **Supported platforms:** `twitter` / `x`, `linkedin`, `facebook` / `fb`, `instagram` / `ig`, `threads`, `bluesky` / `bsky`, `tiktok` / `tt`
66
92
 
67
- ### Posts
93
+ ## Shell autocomplete
68
94
 
69
- ```
70
- ap post create Create a post
71
- ap post list List all posts
72
- ap post get <id> Get a single post
73
- ap post update <id> Update a post
74
- ap post delete <id> Delete a post
75
- ap post retry <id> Retry a failed post
95
+ ```bash
96
+ # Bash
97
+ source <(ap completion bash)
98
+
99
+ # Zsh
100
+ ap completion zsh >> ~/.zshrc && source ~/.zshrc
101
+
102
+ # Fish
103
+ ap completion fish > ~/.config/fish/completions/ap.fish
76
104
  ```
77
105
 
78
- Create options: `--content <text>`, `--connection <id>`, `--schedule <datetime>`, `--now`, `--media <path>`, `--project <id>`.
106
+ ## Aliases
79
107
 
80
- Content can also be piped via stdin:
108
+ Create shortcuts for common workflows:
81
109
 
82
110
  ```bash
83
- echo "Hello from a pipe" | ap post create --connection <id> --now
84
- ```
111
+ # Create shortcuts
112
+ ap alias set tw "post create --connection <twitter-id>"
113
+ ap alias set ig "post create --connection <instagram-id>"
85
114
 
86
- ### Calendar
115
+ # Use them
116
+ ap tw --content "Hello X" --now
117
+ ap ig --content "Hello Instagram" --now
87
118
 
88
- ```
89
- ap calendar import --file <path> Import posts from a JSON file
90
- ap calendar sync --file <path> Sync a calendar file (create/update/delete by external_id)
91
- ap calendar pull Pull scheduled posts as JSON
119
+ # List all aliases
120
+ ap alias list
121
+
122
+ # Delete an alias
123
+ ap alias delete tw
92
124
  ```
93
125
 
94
- #### Import
126
+ ## Calendar
127
+
128
+ ### Import
95
129
 
96
130
  Bulk-create posts from a JSON array:
97
131
 
@@ -105,9 +139,12 @@ Bulk-create posts from a JSON array:
105
139
  ]
106
140
  ```
107
141
 
108
- Options: `--dry-run`, `--project <id>`, `--json`.
142
+ ```bash
143
+ ap calendar import --file posts.json
144
+ ap calendar import --file posts.json --dry-run # preview without creating
145
+ ```
109
146
 
110
- #### Sync
147
+ ### Sync
111
148
 
112
149
  Two-way sync using `external_id` for stable identity:
113
150
 
@@ -122,20 +159,18 @@ Two-way sync using `external_id` for stable identity:
122
159
  ]
123
160
  ```
124
161
 
125
- Options: `--delete-missing`, `--dry-run`, `--project <id>`, `--json`.
162
+ ```bash
163
+ ap calendar sync --file cal.json
164
+ ap calendar sync --file cal.json --delete-missing # remove posts not in file
165
+ ```
126
166
 
127
- #### Pull
167
+ ### Pull
128
168
 
129
- Fetch current posts from the server as a CalendarItem JSON array:
169
+ Fetch current posts as a CalendarItem JSON array:
130
170
 
131
171
  ```bash
132
- # Pull to file
133
172
  ap calendar pull --file cal.json
134
-
135
- # Filter by date range
136
173
  ap calendar pull --from 2026-03-01 --to 2026-03-31
137
-
138
- # Include published posts
139
174
  ap calendar pull --include-published
140
175
  ```
141
176
 
@@ -147,40 +182,30 @@ ap calendar pull --file cal.json # pull current state
147
182
  ap calendar sync --file cal.json # push changes back
148
183
  ```
149
184
 
150
- ### Context
151
-
152
- Dump brand context, connections, and platform rules — useful for feeding to AI tools:
153
-
154
- ```bash
155
- # Markdown output (default)
156
- ap context
157
-
158
- # JSON output
159
- ap context --json
160
-
161
- # Include connection IDs
162
- ap context --verbose
163
- ```
164
-
165
- ### Media
166
-
167
- ```
168
- ap media upload <file> Upload an image or video
169
- ```
170
-
171
- Supported formats: JPEG, PNG, GIF, WebP, MP4, MOV, WebM.
172
-
173
185
  ## Configuration
174
186
 
175
187
  Config is stored at `~/.config/agendapanda/config.json`.
176
188
 
177
- Environment variable overrides:
189
+ ### Environment variables
178
190
 
179
191
  | Variable | Description |
180
192
  |----------|-------------|
181
193
  | `AP_API_KEY` | API key (overrides stored key) |
182
194
  | `AP_API_URL` | API base URL (default: `https://agendapanda.com`) |
183
- | `AP_PROJECT` | Active project ID (overrides stored project) |
195
+ | `AP_PROJECT` | Active project ID (overrides stored value) |
196
+ | `AP_CONNECTION` | Default connection ID (overrides stored value) |
197
+
198
+ ### API key profiles
199
+
200
+ Save multiple API keys and switch between them:
201
+
202
+ ```bash
203
+ ap auth switch --add --name work --key ap_abc123
204
+ ap auth switch --add --name personal --key ap_def456
205
+ ap auth switch --name work
206
+ ap auth switch --list
207
+ ap auth switch --delete --name personal
208
+ ```
184
209
 
185
210
  ## JSON output
186
211
 
@@ -201,8 +226,6 @@ All schedule times must be **UTC ISO 8601 with Z suffix**:
201
226
  "schedule": "2026-03-15T14:00:00" # rejected (no Z)
202
227
  ```
203
228
 
204
- The optional `timezone` field is display/planning metadata only — it does not affect when the post is published.
205
-
206
229
  ## License
207
230
 
208
231
  MIT
package/dist/bin/ap.js CHANGED
@@ -1,7 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  import { CommanderError } from 'commander';
3
+ import { getAliases } from '../src/lib/config.js';
3
4
  import { program, earlyJsonMode } from '../src/index.js';
4
5
  import { outputError } from '../src/lib/output.js';
6
+ import { checkForUpdate, printUpdateBanner } from '../src/lib/update-check.js';
7
+ /**
8
+ * Expand aliases: if argv[2] matches a known alias, replace it with expanded tokens.
9
+ * Handles quoted arguments in the expansion string (e.g. 'post create --content "hello world"').
10
+ */
11
+ function expandAlias(argv) {
12
+ const aliases = getAliases();
13
+ const firstArg = argv[2];
14
+ if (!firstArg || !aliases[firstArg])
15
+ return argv;
16
+ const expansion = aliases[firstArg];
17
+ const expandedTokens = expansion.match(/[^\s"']+|"([^"]*)"|'([^']*)'/g) || [];
18
+ // Strip surrounding quotes from matched tokens
19
+ const cleaned = expandedTokens.map((t) => t.startsWith('"') && t.endsWith('"') ? t.slice(1, -1) :
20
+ t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t);
21
+ const remainingArgs = argv.slice(3);
22
+ return [argv[0], argv[1], ...cleaned, ...remainingArgs];
23
+ }
24
+ process.argv = expandAlias(process.argv);
25
+ // Fire off update check without blocking startup
26
+ const updatePromise = checkForUpdate();
5
27
  try {
6
28
  await program.parseAsync();
7
29
  }
@@ -18,4 +40,14 @@ catch (err) {
18
40
  throw err;
19
41
  }
20
42
  }
43
+ // After command completes, check if an update is available
44
+ try {
45
+ const latestVersion = await updatePromise;
46
+ if (latestVersion) {
47
+ printUpdateBanner(latestVersion);
48
+ }
49
+ }
50
+ catch {
51
+ // Never block exit for update check failures
52
+ }
21
53
  //# sourceMappingURL=ap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ap.js","sourceRoot":"","sources":["../../bin/ap.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,IAAI,CAAC;IACJ,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;AAC5B,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC;IACd,IAAI,GAAG,YAAY,cAAc,EAAE,CAAC;QACnC,yEAAyE;QACzE,+EAA+E;QAC/E,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,IAAI,aAAa,EAAE,CAAC;YACzC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IACjC,CAAC;SAAM,CAAC;QACP,MAAM,GAAG,CAAC;IACX,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"ap.js","sourceRoot":"","sources":["../../bin/ap.ts"],"names":[],"mappings":";AAEA,OAAO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AG,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC;AACzD,CAAC;AAED,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzC,iDAAiD;AACjD,MAAM,aAAa,GAAG,cAAc,EAAE,CAAC;AAEvC,IAAI,CAAC;IACJ,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;AAC5B,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC;IACd,IAAI,GAAG,YAAY,cAAc,EAAE,CAAC;QACnC,yEAAyE;QACzE,+EAA+E;QAC/E,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,IAAI,aAAa,EAAE,CAAC;YACzC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IACjC,CAAC;SAAM,CAAC;QACP,MAAM,GAAG,CAAC;IACX,CAAC;AACF,CAAC;AAED,2DAA2D;AAC3D,IAAI,CAAC;IACJ,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC;IAC1C,IAAI,aAAa,EAAE,CAAC;QACnB,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC;AACF,CAAC;AAAC,MAAM,CAAC;IACR,6CAA6C;AAC9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerAliasCommands(program: Command): void;
@@ -0,0 +1,84 @@
1
+ import chalk from 'chalk';
2
+ import { getAliases, setAlias, deleteAlias } from '../lib/config.js';
3
+ import { initJsonMode, isJsonMode, outputJson, outputTable, outputError, } from '../lib/output.js';
4
+ const ALIAS_NAME_RE = /^[a-z0-9_-]+$/;
5
+ // Commands that cannot be shadowed by aliases
6
+ const RESERVED_COMMANDS = [
7
+ 'auth', 'projects', 'connections', 'post', 'media', 'calendar',
8
+ 'context', 'whoami', 'init', 'completion', 'alias', 'help', 'version',
9
+ ];
10
+ export function registerAliasCommands(program) {
11
+ const alias = program.command('alias').description('Manage command aliases');
12
+ // ap alias set <name> <expansion>
13
+ alias
14
+ .command('set <name> <expansion>')
15
+ .description('Create or update an alias')
16
+ .option('--json', 'Output as JSON')
17
+ .addHelpText('after', `
18
+ Examples:
19
+ ap alias set tw "post create --connection abc123 --now"
20
+ ap alias set mypage "post create --connection xyz789"
21
+ ap tw --content "hello" # expands to: ap post create --connection abc123 --now --content "hello"`)
22
+ .action((name, expansion, options) => {
23
+ initJsonMode(options);
24
+ if (!ALIAS_NAME_RE.test(name)) {
25
+ outputError('Alias name must contain only lowercase letters, numbers, hyphens, and underscores.', 'INVALID_ALIAS_NAME');
26
+ process.exit(1);
27
+ }
28
+ if (RESERVED_COMMANDS.includes(name)) {
29
+ outputError(`"${name}" is a built-in command and cannot be used as an alias.`, 'RESERVED_ALIAS_NAME');
30
+ process.exit(1);
31
+ }
32
+ const existing = getAliases()[name];
33
+ setAlias(name, expansion);
34
+ if (isJsonMode(options)) {
35
+ outputJson({ success: true, item: { name, expansion, overwritten: !!existing } });
36
+ }
37
+ else {
38
+ if (existing) {
39
+ console.log(chalk.yellow('⚠') + ` Overwrote alias ${chalk.bold(name)} (was: ${chalk.dim(`ap ${existing}`)})`);
40
+ }
41
+ console.log(chalk.green('✓') + ` Alias ${chalk.bold(name)} → ${chalk.dim(`ap ${expansion}`)}`);
42
+ }
43
+ });
44
+ // ap alias list
45
+ alias
46
+ .command('list')
47
+ .description('List all aliases')
48
+ .option('--json', 'Output as JSON')
49
+ .action((options) => {
50
+ initJsonMode(options);
51
+ const aliases = getAliases();
52
+ const entries = Object.entries(aliases);
53
+ if (isJsonMode(options)) {
54
+ outputJson({ items: entries.map(([name, expansion]) => ({ name, expansion })) });
55
+ }
56
+ else {
57
+ if (entries.length === 0) {
58
+ console.log(chalk.dim('No aliases defined. Use `ap alias set <name> "<expansion>"` to create one.'));
59
+ return;
60
+ }
61
+ outputTable(['ALIAS', 'EXPANSION'], entries.map(([name, expansion]) => [name, `ap ${expansion}`]));
62
+ }
63
+ });
64
+ // ap alias delete <name>
65
+ alias
66
+ .command('delete <name>')
67
+ .description('Delete an alias')
68
+ .option('--json', 'Output as JSON')
69
+ .action((name, options) => {
70
+ initJsonMode(options);
71
+ const removed = deleteAlias(name);
72
+ if (!removed) {
73
+ outputError(`Alias "${name}" not found.`, 'ALIAS_NOT_FOUND');
74
+ process.exit(1);
75
+ }
76
+ if (isJsonMode(options)) {
77
+ outputJson({ success: true });
78
+ }
79
+ else {
80
+ console.log(chalk.green('✓') + ` Alias ${chalk.bold(name)} deleted.`);
81
+ }
82
+ });
83
+ }
84
+ //# sourceMappingURL=alias.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias.js","sourceRoot":"","sources":["../../../src/commands/alias.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EACN,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,GACX,MAAM,kBAAkB,CAAC;AAE1B,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC,8CAA8C;AAC9C,MAAM,iBAAiB,GAAG;IACzB,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAC9D,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS;CACrE,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACrD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAE7E,kCAAkC;IAClC,KAAK;SACH,OAAO,CAAC,wBAAwB,CAAC;SACjC,WAAW,CAAC,2BAA2B,CAAC;SACxC,MAAM,CAAC,QAAQ,EAAE,g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EAAE;QACrD,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,WAAW,CAAC,UAAU,IAAI,cAAc,EAAE,iBAAiB,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACzB,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,UAAU,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvE,CAAC;IACF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +1,6 @@
1
1
  import { Command } from 'commander';
2
+ /** Shared handler for `ap auth status` and `ap whoami` */
3
+ export declare function authStatusHandler(options: {
4
+ json?: boolean;
5
+ }): Promise<void>;
2
6
  export declare function registerAuthCommands(program: Command): void;