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