autark-cli 0.1.5 → 0.1.7
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/autark.mjs +83 -24
- package/package.json +1 -1
package/autark.mjs
CHANGED
|
@@ -12,7 +12,8 @@ import process from 'node:process'
|
|
|
12
12
|
|
|
13
13
|
const API = process.env.AUTARK_API_URL || 'https://autark-api.kushalsokke.workers.dev'
|
|
14
14
|
const AGENTMAIL_API = process.env.AGENTMAIL_API_URL || 'https://api.agentmail.to/v0'
|
|
15
|
-
const
|
|
15
|
+
const AUTARK_HOME = process.env.AUTARK_HOME || path.join(os.homedir(), '.autark')
|
|
16
|
+
const CREDS_PATH = process.env.AUTARK_CREDENTIALS || path.join(AUTARK_HOME, 'credentials.json')
|
|
16
17
|
|
|
17
18
|
const args = process.argv.slice(2)
|
|
18
19
|
main().catch(err => {
|
|
@@ -35,17 +36,26 @@ async function main() {
|
|
|
35
36
|
if (group === 'product') {
|
|
36
37
|
if (command === 'upsert') return productUpsert(rest)
|
|
37
38
|
if (command === 'list') return productList()
|
|
39
|
+
if (!command || command === '--help' || command === '-h') return productUsage()
|
|
38
40
|
}
|
|
39
41
|
if (group === 'hypothesis') {
|
|
40
42
|
if (command === 'create') return hypothesisCreate(rest)
|
|
41
43
|
if (command === 'status') return hypothesisStatus(rest)
|
|
44
|
+
if (!command || command === '--help' || command === '-h') return hypothesisUsage()
|
|
42
45
|
}
|
|
43
46
|
if (group === 'run') {
|
|
44
47
|
if (command === 'start') return runStart(rest)
|
|
45
48
|
if (command === 'finish') return runFinish(rest)
|
|
49
|
+
if (!command || command === '--help' || command === '-h') return runUsage()
|
|
50
|
+
}
|
|
51
|
+
if (group === 'log') {
|
|
52
|
+
if (command === 'action') return logAction(rest)
|
|
53
|
+
if (!command || command === '--help' || command === '-h') return logUsage()
|
|
54
|
+
}
|
|
55
|
+
if (group === 'context') {
|
|
56
|
+
if (!command || command === '--help' || command === '-h') return contextUsage()
|
|
57
|
+
return context([command, ...rest].filter(Boolean))
|
|
46
58
|
}
|
|
47
|
-
if (group === 'log' && command === 'action') return logAction(rest)
|
|
48
|
-
if (group === 'context') return context([command, ...rest].filter(Boolean))
|
|
49
59
|
if (group === 'mail') return mail(command, rest)
|
|
50
60
|
|
|
51
61
|
usage()
|
|
@@ -619,31 +629,80 @@ Mail uses the inbox-scoped token in ~/.autark/credentials.json.`)
|
|
|
619
629
|
function usage() {
|
|
620
630
|
console.log(`autark — agent runbook CLI
|
|
621
631
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
632
|
+
login send|verify sign in / complete magic code
|
|
633
|
+
logout clear local credentials
|
|
634
|
+
me show signed-in user
|
|
635
|
+
|
|
636
|
+
product upsert|list create/edit/list products
|
|
637
|
+
hypothesis create|status create or update hypotheses
|
|
638
|
+
run start|finish start / finish a run
|
|
639
|
+
log action record one outreach touch
|
|
640
|
+
context [<slug>|...] pull product or hypothesis context
|
|
641
|
+
|
|
642
|
+
mail setup|send|reply|... send/read mail via your AgentMail inbox
|
|
643
|
+
|
|
644
|
+
For details on any group: autark <group> --help
|
|
645
|
+
Examples: autark product --help
|
|
646
|
+
autark mail --help`)
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function productUsage() {
|
|
650
|
+
console.log(`autark product
|
|
651
|
+
|
|
652
|
+
upsert --slug <slug> --name <name> [--url <url>] [--tagline <text>]
|
|
653
|
+
[--brief @./brief.md] [--visibility private|public]
|
|
654
|
+
|
|
655
|
+
list prints slug, visibility, id, name
|
|
656
|
+
|
|
657
|
+
The brief is the markdown the agent reads at the top of every run
|
|
658
|
+
to understand what the product is and who it might serve.`)
|
|
659
|
+
}
|
|
626
660
|
|
|
627
|
-
|
|
628
|
-
autark
|
|
661
|
+
function hypothesisUsage() {
|
|
662
|
+
console.log(`autark hypothesis
|
|
629
663
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
autark hypothesis status --hypothesis-id <id> --status active|inactive|dead
|
|
633
|
-
autark hypothesis status <slug>/<H01> --status active|inactive|dead # alias
|
|
664
|
+
create --product-id <id> --md @./hyp.md [--code H01] [--title <t>] [--status active|inactive|dead]
|
|
665
|
+
create --product <slug> --md @./hyp.md [--code H01] [--title <t>] # slug alias
|
|
634
666
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
667
|
+
status --hypothesis-id <id> --status active|inactive|dead
|
|
668
|
+
status <slug>/<H01> --status active|inactive|dead # slug/code alias
|
|
669
|
+
|
|
670
|
+
Hypotheses are frozen on create. Only --status changes after.
|
|
671
|
+
If --code is omitted, autark picks the next H## for the product.`)
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
function runUsage() {
|
|
675
|
+
console.log(`autark run
|
|
676
|
+
|
|
677
|
+
start --hypothesis-id <id>
|
|
678
|
+
start --hypothesis <slug>/<H01> # slug/code alias
|
|
679
|
+
→ prints RUN_ID to stdout
|
|
680
|
+
|
|
681
|
+
finish --run-id <id> --narrative @./run.md
|
|
682
|
+
→ seals the run with the narrative blob`)
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function logUsage() {
|
|
686
|
+
console.log(`autark log
|
|
687
|
+
|
|
688
|
+
action --run-id <id> --channel <c> --title <t>
|
|
689
|
+
[--url <u>] # github / reddit / hn / blog / gist / linkedin
|
|
690
|
+
[--agentmail-thread-id <uuid>] # email
|
|
691
|
+
[--agentmail-inbox-id <email>] # email — defaults to your inbox
|
|
692
|
+
[--recipient <email>] # email
|
|
693
|
+
[--metadata @./meta.json] # any channel-specific extras
|
|
694
|
+
|
|
695
|
+
One row per external touch. Body content stays in AgentMail/GitHub/etc;
|
|
696
|
+
this just records the pointer + the title agents see on the dashboard.`)
|
|
697
|
+
}
|
|
638
698
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
[--metadata @./meta.json]
|
|
699
|
+
function contextUsage() {
|
|
700
|
+
console.log(`autark context
|
|
642
701
|
|
|
643
|
-
|
|
702
|
+
<slug> product brief + every hypothesis (active/inactive/dead)
|
|
703
|
+
<slug>/<H01> one hypothesis: text + every run + every action
|
|
704
|
+
--product-id <id> product brief + every hypothesis
|
|
705
|
+
--hypothesis-id <id> one hypothesis: text + every run + every action
|
|
644
706
|
|
|
645
|
-
|
|
646
|
-
autark context --hypothesis-id <id>
|
|
647
|
-
autark context <slug>
|
|
648
|
-
autark context <slug>/<H01>`)
|
|
707
|
+
Use product-level first to pick which H## to drill into.`)
|
|
649
708
|
}
|
package/package.json
CHANGED