@dawnai/cli 1.0.3 → 1.0.5
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 +4 -0
- package/dist/index.js +232 -2
- package/package.json +2 -1
- package/postinstall.js +1 -0
- package/skills/dawn-account/SKILL.md +54 -0
- package/skills/dawn-auth/SKILL.md +73 -0
- package/skills/dawn-run-monitor/SKILL.md +77 -0
- package/skills/dawn-run-stop/SKILL.md +56 -0
- package/skills/dawn-strategy-code/SKILL.md +77 -0
- package/skills/dawn-strategy-create/SKILL.md +58 -0
- package/skills/dawn-strategy-launch/SKILL.md +79 -0
- package/skills/dawn-strategy-list/SKILL.md +47 -0
- package/skills/dawn-strategy-positions/SKILL.md +51 -0
- package/skills/dawn-strategy-revise/SKILL.md +55 -0
- package/skills/dawn-strategy-rules/SKILL.md +60 -0
- package/skills/dawn-strategy-status/SKILL.md +56 -0
package/README.md
CHANGED
|
@@ -42,6 +42,9 @@ dawn run list
|
|
|
42
42
|
dawn run status <id>
|
|
43
43
|
dawn run logs <id> [--limit N]
|
|
44
44
|
dawn run stop <id>
|
|
45
|
+
|
|
46
|
+
dawn skill list
|
|
47
|
+
dawn skill install [--force] [--dir <path>]
|
|
45
48
|
```
|
|
46
49
|
|
|
47
50
|
## Environment Variables
|
|
@@ -55,3 +58,4 @@ dawn run stop <id>
|
|
|
55
58
|
|
|
56
59
|
- Auth token is stored at `~/.dawn-cli/config.json`.
|
|
57
60
|
- `dawn account fund` prints the wallet address and Polygon USDC deposit instructions.
|
|
61
|
+
- `dawn skill install` copies bundled Dawn skills into `~/.claude/skills` for Claude Code.
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,74 @@ import os from 'node:os';
|
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import process from 'node:process';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
|
-
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
const CLI_VERSION = '1.0.5';
|
|
9
10
|
const DAWN_API_BASE_URL = 'https://api.dawn.ai';
|
|
10
11
|
const FUNDING_LINK_TEMPLATE = process.env.DAWN_HELIO_LINK_TEMPLATE || '';
|
|
11
12
|
const CLI_HOME = process.env.DAWN_CLI_HOME || path.join(os.homedir(), '.dawn-cli');
|
|
12
13
|
const CONFIG_PATH = path.join(CLI_HOME, 'config.json');
|
|
14
|
+
function getBundledSkillsDir() {
|
|
15
|
+
const currentFilePath = fileURLToPath(import.meta.url);
|
|
16
|
+
const currentDir = path.dirname(currentFilePath);
|
|
17
|
+
return path.join(currentDir, '..', 'skills');
|
|
18
|
+
}
|
|
19
|
+
function getClaudeSkillsDir() {
|
|
20
|
+
return path.join(os.homedir(), '.claude', 'skills');
|
|
21
|
+
}
|
|
22
|
+
function parseSkillDescription(content) {
|
|
23
|
+
const descriptionMatch = content.match(/^description:\s*(.+)$/m);
|
|
24
|
+
return descriptionMatch?.[1]?.replace(/^["']|["']$/g, '') ?? '';
|
|
25
|
+
}
|
|
26
|
+
async function pathExists(targetPath) {
|
|
27
|
+
try {
|
|
28
|
+
await fs.access(targetPath);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function listBundledSkills() {
|
|
36
|
+
const skillsDir = getBundledSkillsDir();
|
|
37
|
+
if (!(await pathExists(skillsDir))) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const entries = await fs.readdir(skillsDir, { withFileTypes: true });
|
|
41
|
+
const skills = await Promise.all(entries
|
|
42
|
+
.filter((entry) => entry.isDirectory())
|
|
43
|
+
.map(async (entry) => {
|
|
44
|
+
const skillFilePath = path.join(skillsDir, entry.name, 'SKILL.md');
|
|
45
|
+
if (!(await pathExists(skillFilePath))) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const content = await fs.readFile(skillFilePath, 'utf8');
|
|
49
|
+
return {
|
|
50
|
+
name: entry.name,
|
|
51
|
+
description: parseSkillDescription(content),
|
|
52
|
+
};
|
|
53
|
+
}));
|
|
54
|
+
return skills
|
|
55
|
+
.filter((skill) => skill !== null)
|
|
56
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
57
|
+
}
|
|
58
|
+
async function installBundledSkills(force, dir) {
|
|
59
|
+
const skillsDir = getBundledSkillsDir();
|
|
60
|
+
const destinationDir = dir ?? getClaudeSkillsDir();
|
|
61
|
+
const skills = await listBundledSkills();
|
|
62
|
+
await fs.mkdir(destinationDir, { recursive: true });
|
|
63
|
+
const results = [];
|
|
64
|
+
for (const skill of skills) {
|
|
65
|
+
const src = path.join(skillsDir, skill.name);
|
|
66
|
+
const dest = path.join(destinationDir, skill.name);
|
|
67
|
+
if ((await pathExists(dest)) && !force) {
|
|
68
|
+
results.push({ name: skill.name, installed: false });
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
await fs.cp(src, dest, { recursive: true, force: true });
|
|
72
|
+
results.push({ name: skill.name, installed: true });
|
|
73
|
+
}
|
|
74
|
+
return results;
|
|
75
|
+
}
|
|
13
76
|
async function ensureDir() {
|
|
14
77
|
await fs.mkdir(CLI_HOME, { recursive: true });
|
|
15
78
|
}
|
|
@@ -103,6 +166,7 @@ function printUsage() {
|
|
|
103
166
|
dawn strategy list
|
|
104
167
|
dawn strategy create <text>
|
|
105
168
|
dawn strategy status <id>
|
|
169
|
+
dawn strategy positions <id> [--strategy-id <strategyId>]
|
|
106
170
|
dawn strategy revise <id> <text>
|
|
107
171
|
dawn strategy rules <id> list
|
|
108
172
|
dawn strategy rules <id> approve <rule-index>
|
|
@@ -118,6 +182,11 @@ function printUsage() {
|
|
|
118
182
|
dawn run logs <id> [--limit N]
|
|
119
183
|
dawn run stop <id>
|
|
120
184
|
|
|
185
|
+
dawn skill list
|
|
186
|
+
dawn skill install [--force] [--dir <path>]
|
|
187
|
+
|
|
188
|
+
dawn update
|
|
189
|
+
|
|
121
190
|
dawn --version
|
|
122
191
|
|
|
123
192
|
Environment variables:
|
|
@@ -664,12 +733,45 @@ function renderAgentOverview(conversationId, conversation, strategies) {
|
|
|
664
733
|
console.log(`- ${strategy.id ?? 'unknown'} | ${strategy.strategyType || 'unknown'} | ${label} | pnl=${formatUsd(strategy.totalPnl || '0')} | terminateAt=${formatTimestamp(strategy.terminateAt)}`);
|
|
665
734
|
}
|
|
666
735
|
}
|
|
736
|
+
function renderStrategyPositions(conversationId, strategy, positions) {
|
|
737
|
+
const strategyId = String(strategy.id ?? 'unknown');
|
|
738
|
+
const strategyType = strategy.strategyType || 'unknown';
|
|
739
|
+
const strategyState = strategy.isRunning ? 'running' : 'stopped';
|
|
740
|
+
const walletId = strategy.walletId || 'unknown';
|
|
741
|
+
console.log(`Strategy positions for conversation ${conversationId}`);
|
|
742
|
+
console.log('='.repeat(`Strategy positions for conversation ${conversationId}`.length));
|
|
743
|
+
printKeyValue('Strategy ID', strategyId);
|
|
744
|
+
printKeyValue('Mode', strategyType);
|
|
745
|
+
printKeyValue('State', strategyState);
|
|
746
|
+
printKeyValue('Wallet', shortId(walletId));
|
|
747
|
+
printKeyValue('Position count', String(positions.length));
|
|
748
|
+
if (!positions.length) {
|
|
749
|
+
console.log('\nNo positions found for this strategy.');
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const totalCurrent = positions.reduce((sum, position) => sum + formatNumeric(position.currentValue), 0);
|
|
753
|
+
const totalCost = positions.reduce((sum, position) => sum + formatNumeric(position.costBasis), 0);
|
|
754
|
+
const totalPnl = positions.reduce((sum, position) => sum + formatNumeric(position.unrealizedPnl), 0);
|
|
755
|
+
printSection('Summary');
|
|
756
|
+
printKeyValue('Total current value', formatUsd(totalCurrent));
|
|
757
|
+
printKeyValue('Total cost basis', formatUsd(totalCost));
|
|
758
|
+
printKeyValue('Total unrealized PnL', `${formatUsd(totalPnl)} (${formatPercent(totalCost === 0 ? 0 : (totalPnl / totalCost) * 100)})`);
|
|
759
|
+
printSection('Positions');
|
|
760
|
+
const sorted = [...positions].sort((a, b) => formatNumeric(b.currentValue) - formatNumeric(a.currentValue));
|
|
761
|
+
for (const position of sorted) {
|
|
762
|
+
const title = position.marketTitle ||
|
|
763
|
+
position.groupItemTitle ||
|
|
764
|
+
`asset:${shortId(position.assetId || position.id)}`;
|
|
765
|
+
console.log(`- ${title} | value=${formatUsd(position.currentValue || '0')} | cost=${formatUsd(position.costBasis || '0')} | pnl=${formatUsd(position.unrealizedPnl || '0')} (${formatPercent(position.unrealizedPnlPercentage || '0')}) | amount=${formatNumeric(position.amount).toFixed(4)}`);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
667
768
|
async function handleStrategy(args) {
|
|
668
769
|
if (args.includes('--help') || args.includes('-h')) {
|
|
669
770
|
console.log(`Usage:
|
|
670
771
|
dawn strategy list
|
|
671
772
|
dawn strategy create <text>
|
|
672
773
|
dawn strategy status <id>
|
|
774
|
+
dawn strategy positions <id> [--strategy-id <strategyId>]
|
|
673
775
|
dawn strategy revise <id> <text>
|
|
674
776
|
dawn strategy rules <id> list
|
|
675
777
|
dawn strategy rules <id> approve <rule-index>
|
|
@@ -689,7 +791,16 @@ async function handleStrategy(args) {
|
|
|
689
791
|
if (!primaryCommand) {
|
|
690
792
|
throw new Error('Missing strategy command.');
|
|
691
793
|
}
|
|
692
|
-
if (![
|
|
794
|
+
if (![
|
|
795
|
+
'list',
|
|
796
|
+
'create',
|
|
797
|
+
'status',
|
|
798
|
+
'positions',
|
|
799
|
+
'revise',
|
|
800
|
+
'rules',
|
|
801
|
+
'code',
|
|
802
|
+
'launch',
|
|
803
|
+
].includes(primaryCommand)) {
|
|
693
804
|
throw new Error(`Unknown strategy command: ${primaryCommand}. Run \`dawn strategy --help\` for available commands.`);
|
|
694
805
|
}
|
|
695
806
|
let subcommand = primaryCommand;
|
|
@@ -753,6 +864,15 @@ async function handleStrategy(args) {
|
|
|
753
864
|
subcommand = '__status';
|
|
754
865
|
rest.splice(0, rest.length, conversationId);
|
|
755
866
|
}
|
|
867
|
+
if (primaryCommand === 'positions') {
|
|
868
|
+
const conversationId = rest[0];
|
|
869
|
+
const { flags } = parseFlags(rest.slice(1));
|
|
870
|
+
if (!conversationId) {
|
|
871
|
+
throw new Error('Usage: dawn strategy positions <id> [--strategy-id <strategyId>]');
|
|
872
|
+
}
|
|
873
|
+
subcommand = '__positions';
|
|
874
|
+
rest.splice(0, rest.length, conversationId, typeof flags['strategy-id'] === 'string' ? flags['strategy-id'] : '');
|
|
875
|
+
}
|
|
756
876
|
if (primaryCommand === 'revise') {
|
|
757
877
|
const conversationId = rest[0];
|
|
758
878
|
const text = rest.slice(1).join(' ').trim();
|
|
@@ -963,6 +1083,35 @@ async function handleStrategy(args) {
|
|
|
963
1083
|
console.log(`Sent edit request to strategy ${conversationId}.`);
|
|
964
1084
|
return;
|
|
965
1085
|
}
|
|
1086
|
+
if (subcommand === '__positions') {
|
|
1087
|
+
const conversationId = rest[0];
|
|
1088
|
+
const requestedStrategyId = rest[1];
|
|
1089
|
+
if (!conversationId) {
|
|
1090
|
+
throw new Error('Usage: dawn strategy positions <id> [--strategy-id <strategyId>]');
|
|
1091
|
+
}
|
|
1092
|
+
const strategiesRaw = (await apiFetch(config, `/strategy/conversation/${conversationId}`));
|
|
1093
|
+
const strategies = Array.isArray(strategiesRaw) ? strategiesRaw : [];
|
|
1094
|
+
if (!strategies.length) {
|
|
1095
|
+
throw new Error(`No strategies found for conversation ${conversationId}.`);
|
|
1096
|
+
}
|
|
1097
|
+
const selectedStrategy = (requestedStrategyId
|
|
1098
|
+
? strategies.find((strategy) => String(strategy.id) === requestedStrategyId)
|
|
1099
|
+
: null) ||
|
|
1100
|
+
strategies.find((strategy) => strategy.isRunning) ||
|
|
1101
|
+
strategies[0];
|
|
1102
|
+
if (!selectedStrategy?.id) {
|
|
1103
|
+
throw new Error('Could not determine strategy for this conversation.');
|
|
1104
|
+
}
|
|
1105
|
+
if (!selectedStrategy.walletId) {
|
|
1106
|
+
throw new Error(`Could not determine wallet for strategy ${selectedStrategy.id}.`);
|
|
1107
|
+
}
|
|
1108
|
+
const response = (await apiFetch(config, `/v1/vault-metadata/${selectedStrategy.walletId}/positions?strategyIds=${encodeURIComponent(String(selectedStrategy.id))}`));
|
|
1109
|
+
const positions = Array.isArray(response?.positions)
|
|
1110
|
+
? response.positions
|
|
1111
|
+
: [];
|
|
1112
|
+
renderStrategyPositions(conversationId, selectedStrategy, positions);
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
966
1115
|
if (subcommand === 'launch') {
|
|
967
1116
|
const conversationId = rest[0];
|
|
968
1117
|
const { flags } = parseFlags(rest.slice(1));
|
|
@@ -1228,6 +1377,79 @@ async function handleRun(args) {
|
|
|
1228
1377
|
}
|
|
1229
1378
|
throw new Error(`Unknown run command: ${subcommand}`);
|
|
1230
1379
|
}
|
|
1380
|
+
async function handleSkill(args) {
|
|
1381
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
1382
|
+
console.log(`Usage:
|
|
1383
|
+
dawn skill list
|
|
1384
|
+
dawn skill install [--force] [--dir <path>]`);
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1387
|
+
const [subcommand, ...rest] = args;
|
|
1388
|
+
if (!subcommand) {
|
|
1389
|
+
throw new Error('Missing skill command. Run: dawn skill <list|install>');
|
|
1390
|
+
}
|
|
1391
|
+
if (subcommand === 'list') {
|
|
1392
|
+
const skills = await listBundledSkills();
|
|
1393
|
+
if (!skills.length) {
|
|
1394
|
+
console.log('No bundled skills found.');
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
const nameWidth = Math.max(8, ...skills.map((skill) => skill.name.length));
|
|
1398
|
+
console.log(`${'SKILL'.padEnd(nameWidth)} DESCRIPTION`);
|
|
1399
|
+
console.log(`${'-'.repeat(nameWidth)} ${'-'.repeat(60)}`);
|
|
1400
|
+
for (const skill of skills) {
|
|
1401
|
+
console.log(`${skill.name.padEnd(nameWidth)} ${skill.description}`);
|
|
1402
|
+
}
|
|
1403
|
+
console.log(`\n${skills.length} skill${skills.length === 1 ? '' : 's'}`);
|
|
1404
|
+
return;
|
|
1405
|
+
}
|
|
1406
|
+
if (subcommand === 'install') {
|
|
1407
|
+
const { flags } = parseFlags(rest);
|
|
1408
|
+
const force = flags.force === true;
|
|
1409
|
+
const dir = typeof flags.dir === 'string' ? flags.dir : undefined;
|
|
1410
|
+
const destinationDir = dir ?? getClaudeSkillsDir();
|
|
1411
|
+
const results = await installBundledSkills(force, dir);
|
|
1412
|
+
if (!results.length) {
|
|
1413
|
+
console.log('No bundled skills found to install.');
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
const installedCount = results.filter((result) => result.installed).length;
|
|
1417
|
+
const skippedCount = results.length - installedCount;
|
|
1418
|
+
console.log(`Installing Dawn skills to ${destinationDir}`);
|
|
1419
|
+
for (const result of results) {
|
|
1420
|
+
console.log(`- ${result.name}: ${result.installed ? 'installed' : 'skipped (already exists)'}`);
|
|
1421
|
+
}
|
|
1422
|
+
console.log(`\nInstalled ${installedCount}/${results.length} skill(s)${skippedCount ? `, skipped ${skippedCount}` : ''}.`);
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1425
|
+
throw new Error(`Unknown skill command: ${subcommand}`);
|
|
1426
|
+
}
|
|
1427
|
+
async function handleUpdate() {
|
|
1428
|
+
console.log('Checking for updates...');
|
|
1429
|
+
const result = await new Promise((resolve) => {
|
|
1430
|
+
const child = spawn('npm', ['install', '-g', '@dawnai/cli@latest'], {
|
|
1431
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
1432
|
+
shell: true,
|
|
1433
|
+
});
|
|
1434
|
+
let stdout = '';
|
|
1435
|
+
let stderr = '';
|
|
1436
|
+
child.stdout.on('data', (data) => { stdout += data.toString(); });
|
|
1437
|
+
child.stderr.on('data', (data) => { stderr += data.toString(); });
|
|
1438
|
+
child.on('close', (code) => { resolve({ code: code ?? 1, stdout, stderr }); });
|
|
1439
|
+
});
|
|
1440
|
+
if (result.code !== 0) {
|
|
1441
|
+
throw new Error(`Update failed: ${result.stderr.trim() || result.stdout.trim()}`);
|
|
1442
|
+
}
|
|
1443
|
+
// Extract installed version from npm output
|
|
1444
|
+
const versionMatch = result.stderr.match(/@dawnai\/cli@(\S+)/) || result.stdout.match(/@dawnai\/cli@(\S+)/);
|
|
1445
|
+
const newVersion = versionMatch?.[1] ?? 'latest';
|
|
1446
|
+
if (newVersion === CLI_VERSION) {
|
|
1447
|
+
console.log(`Already on the latest version (${CLI_VERSION}).`);
|
|
1448
|
+
}
|
|
1449
|
+
else {
|
|
1450
|
+
console.log(`Updated dawn-cli from ${CLI_VERSION} to ${newVersion}.`);
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1231
1453
|
async function main() {
|
|
1232
1454
|
const [cmd, ...args] = process.argv.slice(2);
|
|
1233
1455
|
if (cmd === '--version' || cmd === '-V' || cmd === 'version') {
|
|
@@ -1255,6 +1477,14 @@ async function main() {
|
|
|
1255
1477
|
await handleRun(args);
|
|
1256
1478
|
return;
|
|
1257
1479
|
}
|
|
1480
|
+
if (cmd === 'skill') {
|
|
1481
|
+
await handleSkill(args);
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
if (cmd === 'update') {
|
|
1485
|
+
await handleUpdate();
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1258
1488
|
throw new Error(`Unknown command: ${cmd}`);
|
|
1259
1489
|
}
|
|
1260
1490
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dawnai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "User-facing Dawn CLI",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
+
"skills",
|
|
15
16
|
"README.md",
|
|
16
17
|
"CLAUDE.md",
|
|
17
18
|
"postinstall.js"
|
package/postinstall.js
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-account
|
|
3
|
+
description: View account balances, portfolio summary, wallet holdings, and deposit instructions. Use for "what's in my account", funding, or checking balances.
|
|
4
|
+
tags: [portfolio, funding]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Account overview and funding
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
View account balances, vault summaries, wallet holdings, and get deposit instructions for funding your Dawn account.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Full account overview — balances, vaults, portfolio summary
|
|
17
|
+
dawn account overview
|
|
18
|
+
|
|
19
|
+
# Print wallet address and USDC deposit instructions
|
|
20
|
+
dawn account fund
|
|
21
|
+
|
|
22
|
+
# Wallet balances only
|
|
23
|
+
dawn account wallet
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
1. Run `dawn account overview` for a full snapshot of balances and vaults.
|
|
29
|
+
2. If the user needs to add funds, run `dawn account fund` to get the deposit address and instructions.
|
|
30
|
+
3. For a quick balance check, run `dawn account wallet`.
|
|
31
|
+
|
|
32
|
+
## Example flows
|
|
33
|
+
|
|
34
|
+
**Portfolio check:**
|
|
35
|
+
1. User: "What's in my Dawn account?"
|
|
36
|
+
2. Run: `dawn account overview`
|
|
37
|
+
3. Present: balances, active vaults, total portfolio value.
|
|
38
|
+
|
|
39
|
+
**Funding for a live run:**
|
|
40
|
+
1. User wants to launch a live strategy but needs funds.
|
|
41
|
+
2. Run: `dawn account fund`
|
|
42
|
+
3. Present: wallet address and USDC deposit instructions.
|
|
43
|
+
4. User deposits USDC, then proceed to launch.
|
|
44
|
+
|
|
45
|
+
## Notes
|
|
46
|
+
|
|
47
|
+
- `dawn account fund` shows the wallet address to deposit USDC to.
|
|
48
|
+
- Funding is required before launching live strategy runs.
|
|
49
|
+
- Paper runs do not require funding.
|
|
50
|
+
|
|
51
|
+
## Related skills
|
|
52
|
+
|
|
53
|
+
- **dawn-auth** — Authenticate before checking account.
|
|
54
|
+
- **dawn-strategy-launch** — Launch a run after confirming funding.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-auth
|
|
3
|
+
description: Install the Dawn CLI, authenticate, and manage auth state. Use when commands fail with auth errors, for login, or to check auth status.
|
|
4
|
+
tags: [setup]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Dawn auth and setup
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @dawnai/cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Verify installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
dawn --version
|
|
19
|
+
dawn --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Auth commands
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Log in (opens browser for interactive auth)
|
|
26
|
+
dawn auth login
|
|
27
|
+
|
|
28
|
+
# Check if authenticated
|
|
29
|
+
dawn auth status
|
|
30
|
+
|
|
31
|
+
# Log out (remove local token)
|
|
32
|
+
dawn auth logout
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Headless authentication
|
|
36
|
+
|
|
37
|
+
For CI, agents, or headless environments, set the JWT token directly:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
export DAWN_JWT_TOKEN="<token>"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This bypasses `dawn auth login` entirely. The token is used for all subsequent commands.
|
|
44
|
+
|
|
45
|
+
## Workflow
|
|
46
|
+
|
|
47
|
+
1. Run `dawn auth status` to check if authenticated.
|
|
48
|
+
2. If not authenticated, run `dawn auth login` (opens browser).
|
|
49
|
+
3. After login completes, verify with `dawn auth status`.
|
|
50
|
+
4. If in a headless environment, set `DAWN_JWT_TOKEN` instead.
|
|
51
|
+
|
|
52
|
+
## Environment variables
|
|
53
|
+
|
|
54
|
+
| Variable | Description |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `DAWN_JWT_TOKEN` | Auth token for headless/CI/agent use. Bypasses `dawn auth login`. |
|
|
57
|
+
| `DAWN_CLI_HOME` | Override config directory (default: `~/.dawn-cli`). |
|
|
58
|
+
| `DAWN_API_BASE_URL` | Override API base URL (default: `https://api.dawn.ai`). |
|
|
59
|
+
|
|
60
|
+
## Config locations
|
|
61
|
+
|
|
62
|
+
- **Auth token and settings:** `~/.dawn-cli/config.json`
|
|
63
|
+
|
|
64
|
+
## Troubleshooting
|
|
65
|
+
|
|
66
|
+
- `"Not authenticated. Run: dawn auth login"` — run `dawn auth login` and retry.
|
|
67
|
+
- Auth callback completes but CLI appears stuck — interrupt once and retry login.
|
|
68
|
+
- Headless environment — use `DAWN_JWT_TOKEN` instead of interactive login.
|
|
69
|
+
|
|
70
|
+
## Related skills
|
|
71
|
+
|
|
72
|
+
- **dawn-account** — Check account balances after authenticating.
|
|
73
|
+
- **dawn-strategy-create** — Create a strategy once authenticated.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-run-monitor
|
|
3
|
+
description: Monitor strategy runs — list all runs, check status, and view execution logs. Use for run health checks, debugging, or tracking active strategies.
|
|
4
|
+
tags: [monitoring, operations]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Monitor runs
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Monitor active and past strategy runs — list all runs, check individual run status, and view execution logs for debugging or health checks.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# List all strategies and their runs
|
|
17
|
+
dawn run list
|
|
18
|
+
|
|
19
|
+
# Check status of a specific run
|
|
20
|
+
dawn run status <conversationId>
|
|
21
|
+
|
|
22
|
+
# View execution logs
|
|
23
|
+
dawn run logs <conversationId> [--limit N]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Workflow: Active monitoring
|
|
27
|
+
|
|
28
|
+
1. Run `dawn run status <conversationId>` — check `isRunning`, status, and active strategy IDs.
|
|
29
|
+
2. Run `dawn strategy positions <conversationId>` — check holdings and PnL.
|
|
30
|
+
3. Run `dawn run logs <conversationId> --limit 20` — review recent execution details.
|
|
31
|
+
4. If records look stale or missing, wait briefly and retry once.
|
|
32
|
+
|
|
33
|
+
## Workflow: Find a run
|
|
34
|
+
|
|
35
|
+
1. Run `dawn run list` to see all strategies and runs.
|
|
36
|
+
2. Identify the target run by name or state.
|
|
37
|
+
3. Use `dawn run status <conversationId>` for details.
|
|
38
|
+
|
|
39
|
+
## Example flows
|
|
40
|
+
|
|
41
|
+
**Health check:**
|
|
42
|
+
1. User: "How's my strategy doing?"
|
|
43
|
+
2. Run: `dawn run status <id>`
|
|
44
|
+
3. Run: `dawn strategy positions <id>`
|
|
45
|
+
4. Present: running state, position summary, PnL.
|
|
46
|
+
|
|
47
|
+
**Debug an issue:**
|
|
48
|
+
1. User: "My strategy seems stuck."
|
|
49
|
+
2. Run: `dawn run status <id>` — check if still running.
|
|
50
|
+
3. Run: `dawn run logs <id> --limit 50` — look for errors or stalled execution.
|
|
51
|
+
4. Present findings and recommend action.
|
|
52
|
+
|
|
53
|
+
**List everything:**
|
|
54
|
+
1. User: "Show me all my runs."
|
|
55
|
+
2. Run: `dawn run list`
|
|
56
|
+
3. Present: all strategies with their run states.
|
|
57
|
+
|
|
58
|
+
## Monitoring checklist
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
- [ ] Run status checked (isRunning, state)
|
|
62
|
+
- [ ] Positions reviewed (holdings, PnL)
|
|
63
|
+
- [ ] Logs inspected (recent activity, errors)
|
|
64
|
+
- [ ] Stale data ruled out (retry if needed)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Notes
|
|
68
|
+
|
|
69
|
+
- `--limit N` on logs controls how many log entries to show (default varies).
|
|
70
|
+
- For continuous monitoring, repeat the status/positions/logs cycle periodically.
|
|
71
|
+
- If a run shows errors in logs, consider stopping and re-launching after investigation.
|
|
72
|
+
|
|
73
|
+
## Related skills
|
|
74
|
+
|
|
75
|
+
- **dawn-strategy-positions** — Detailed position and PnL view.
|
|
76
|
+
- **dawn-run-stop** — Stop a run if issues are found.
|
|
77
|
+
- **dawn-strategy-status** — Full strategy context including code and rules.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-run-stop
|
|
3
|
+
description: Stop a running strategy. Use when the user wants to halt, terminate, or shut down an active strategy run.
|
|
4
|
+
tags: [operations]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Stop a run
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Safely stop an active strategy run. Always verify the stop was successful afterward.
|
|
12
|
+
|
|
13
|
+
## Command
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dawn run stop <conversationId>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Workflow
|
|
20
|
+
|
|
21
|
+
1. Confirm the run is active: `dawn run status <conversationId>`.
|
|
22
|
+
2. Stop the run: `dawn run stop <conversationId>`.
|
|
23
|
+
3. Verify it stopped: `dawn run status <conversationId>` — confirm `isRunning` is false.
|
|
24
|
+
|
|
25
|
+
## Example flows
|
|
26
|
+
|
|
27
|
+
**User-requested stop:**
|
|
28
|
+
1. User: "Stop my strategy."
|
|
29
|
+
2. Run: `dawn run status <id>` — confirm it's running.
|
|
30
|
+
3. Run: `dawn run stop <id>`.
|
|
31
|
+
4. Run: `dawn run status <id>` — verify stopped.
|
|
32
|
+
5. Present: final status, last positions.
|
|
33
|
+
|
|
34
|
+
**Emergency stop:**
|
|
35
|
+
1. User: "Kill it now!"
|
|
36
|
+
2. Run: `dawn run stop <id>` immediately.
|
|
37
|
+
3. Verify: `dawn run status <id>`.
|
|
38
|
+
4. Check final positions: `dawn strategy positions <id>`.
|
|
39
|
+
|
|
40
|
+
## Troubleshooting
|
|
41
|
+
|
|
42
|
+
- `"No strategies found for this agent"` — verify the `conversationId` is correct. Check `dawn run list`.
|
|
43
|
+
- Run still shows as active after stop — wait a few seconds and re-check `dawn run status`.
|
|
44
|
+
- If the run won't stop, check `dawn run logs` for errors.
|
|
45
|
+
|
|
46
|
+
## Notes
|
|
47
|
+
|
|
48
|
+
- Always verify the stop was successful with a follow-up `dawn run status`.
|
|
49
|
+
- Stopping a live run does not automatically close open positions — check positions after stopping.
|
|
50
|
+
- The `conversationId` is the same one used across all strategy and run commands.
|
|
51
|
+
|
|
52
|
+
## Related skills
|
|
53
|
+
|
|
54
|
+
- **dawn-run-monitor** — Check status before and after stopping.
|
|
55
|
+
- **dawn-strategy-positions** — Review final positions after stopping.
|
|
56
|
+
- **dawn-strategy-launch** — Re-launch the strategy if needed.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-strategy-code
|
|
3
|
+
description: Generate, check status, export, or upload strategy code. Use when managing the code lifecycle of a strategy.
|
|
4
|
+
tags: [strategy, code]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Strategy code
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Manage the code lifecycle for a strategy — trigger generation, poll for completion, export to files, or upload custom code.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Check code generation status
|
|
17
|
+
dawn strategy code <conversationId> status
|
|
18
|
+
|
|
19
|
+
# Start code generation (requires all rules approved)
|
|
20
|
+
dawn strategy code <conversationId> generate
|
|
21
|
+
|
|
22
|
+
# Export generated code to a file
|
|
23
|
+
dawn strategy code <conversationId> export [--out <path>] [--json]
|
|
24
|
+
|
|
25
|
+
# Upload code from a local file
|
|
26
|
+
dawn strategy code <conversationId> upload <path-to-file>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Workflow: Generate code
|
|
30
|
+
|
|
31
|
+
1. Ensure all rules are approved: `dawn strategy rules <id> list`.
|
|
32
|
+
2. Start generation: `dawn strategy code <id> generate`.
|
|
33
|
+
3. Poll for completion: `dawn strategy code <id> status` (repeat until done).
|
|
34
|
+
4. Once complete, optionally export: `dawn strategy code <id> export --out ./strategy.ts`.
|
|
35
|
+
|
|
36
|
+
## Workflow: Upload custom code
|
|
37
|
+
|
|
38
|
+
1. Write or modify strategy code locally.
|
|
39
|
+
2. Upload: `dawn strategy code <id> upload ./my-strategy.ts`.
|
|
40
|
+
3. Proceed to launch.
|
|
41
|
+
|
|
42
|
+
## Export options
|
|
43
|
+
|
|
44
|
+
- **Default:** prints code to stdout.
|
|
45
|
+
- **`--out <path>`:** writes code to the specified file.
|
|
46
|
+
- **`--json`:** exports as a JSON map (useful for multi-file strategies).
|
|
47
|
+
|
|
48
|
+
## Example flows
|
|
49
|
+
|
|
50
|
+
**Standard code generation:**
|
|
51
|
+
1. Run: `dawn strategy code <id> generate`
|
|
52
|
+
2. Run: `dawn strategy code <id> status` — check if complete.
|
|
53
|
+
3. If still generating, wait and re-check.
|
|
54
|
+
4. Once done: `dawn strategy code <id> export --out ./strategy.ts`
|
|
55
|
+
|
|
56
|
+
**Custom code upload:**
|
|
57
|
+
1. User has a custom strategy file.
|
|
58
|
+
2. Run: `dawn strategy code <id> upload ./custom-strategy.ts`
|
|
59
|
+
3. Proceed to launch.
|
|
60
|
+
|
|
61
|
+
**Inspect generated code:**
|
|
62
|
+
1. Run: `dawn strategy code <id> export --json`
|
|
63
|
+
2. Review the code structure and logic.
|
|
64
|
+
3. If changes are needed, modify locally and re-upload.
|
|
65
|
+
|
|
66
|
+
## Notes
|
|
67
|
+
|
|
68
|
+
- Code generation requires all rules to be approved first.
|
|
69
|
+
- Generation is asynchronous — poll `status` until it completes.
|
|
70
|
+
- `--json` export is useful for strategies with multiple files.
|
|
71
|
+
- Uploaded code replaces any previously generated code.
|
|
72
|
+
|
|
73
|
+
## Related skills
|
|
74
|
+
|
|
75
|
+
- **dawn-strategy-rules** — Approve rules before generating code.
|
|
76
|
+
- **dawn-strategy-launch** — Launch a run after code is ready.
|
|
77
|
+
- **dawn-strategy-revise** — Revise strategy if generated code doesn't match intent.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-strategy-create
|
|
3
|
+
description: Create a new trading strategy from a plain-English prompt. Use when the user wants to build a new strategy or agent.
|
|
4
|
+
tags: [strategy]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create a strategy
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Create a new trading strategy from a plain-English description. Dawn's AI interprets the prompt, generates rules, and prepares code — all starting from a single command.
|
|
12
|
+
|
|
13
|
+
## Command
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dawn strategy create "<plain-English description>"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The command returns a `conversationId` — capture this, as it's used for all subsequent strategy operations.
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
1. Confirm the user is authenticated: `dawn auth status`.
|
|
24
|
+
2. Run `dawn strategy create "<description>"` with the user's intent.
|
|
25
|
+
3. Capture the returned `conversationId`.
|
|
26
|
+
4. Proceed to review rules: `dawn strategy rules <conversationId> list`.
|
|
27
|
+
|
|
28
|
+
## Example flows
|
|
29
|
+
|
|
30
|
+
**Simple strategy:**
|
|
31
|
+
1. User: "Create a strategy that buys SOL when RSI drops below 30."
|
|
32
|
+
2. Run: `dawn strategy create "Buy SOL when RSI drops below 30"`
|
|
33
|
+
3. Capture `conversationId` from output.
|
|
34
|
+
4. Present the conversationId and next steps (review rules, generate code).
|
|
35
|
+
|
|
36
|
+
**Complex strategy:**
|
|
37
|
+
1. User: "Build a mean-reversion strategy on ETH/USDC with 2% bands and 4-hour timeframe."
|
|
38
|
+
2. Run: `dawn strategy create "Mean-reversion strategy on ETH/USDC with 2% bands and 4-hour timeframe"`
|
|
39
|
+
3. Capture `conversationId`.
|
|
40
|
+
4. Review generated rules, revise if needed.
|
|
41
|
+
|
|
42
|
+
## Tips
|
|
43
|
+
|
|
44
|
+
- Be descriptive in the prompt — include assets, conditions, timeframes, and risk parameters.
|
|
45
|
+
- The prompt is interpreted by AI, so natural language works well.
|
|
46
|
+
- After creation, always review the generated rules before generating code.
|
|
47
|
+
- If the strategy doesn't match intent, use `dawn strategy revise` to iterate.
|
|
48
|
+
|
|
49
|
+
## Required output
|
|
50
|
+
|
|
51
|
+
Always return the `conversationId` after creation — it's the key for all strategy operations.
|
|
52
|
+
|
|
53
|
+
## Related skills
|
|
54
|
+
|
|
55
|
+
- **dawn-strategy-revise** — Iterate on the strategy after creation.
|
|
56
|
+
- **dawn-strategy-rules** — Review and approve generated rules.
|
|
57
|
+
- **dawn-strategy-code** — Generate code after rules are approved.
|
|
58
|
+
- **dawn-strategy-list** — List all existing strategies.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-strategy-launch
|
|
3
|
+
description: Launch a strategy as a paper or live run with a specified budget. Use when the user wants to start running a strategy.
|
|
4
|
+
tags: [strategy, operations]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Launch a strategy
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Launch a strategy run — either paper (simulated) or live (real funds). Specify a USD budget and optionally a duration.
|
|
12
|
+
|
|
13
|
+
## Command
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Paper run (default)
|
|
17
|
+
dawn strategy launch <conversationId> --budget <usd>
|
|
18
|
+
|
|
19
|
+
# Live run
|
|
20
|
+
dawn strategy launch <conversationId> --budget <usd> --live
|
|
21
|
+
|
|
22
|
+
# With custom duration (hours)
|
|
23
|
+
dawn strategy launch <conversationId> --budget <usd> --hours <N>
|
|
24
|
+
|
|
25
|
+
# Live run with duration
|
|
26
|
+
dawn strategy launch <conversationId> --budget <usd> --live --hours <N>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Prerequisites
|
|
30
|
+
|
|
31
|
+
Before launching, verify:
|
|
32
|
+
1. Strategy code is ready: `dawn strategy code <id> status`
|
|
33
|
+
2. For live runs, account is funded: `dawn account fund`
|
|
34
|
+
|
|
35
|
+
## Workflow
|
|
36
|
+
|
|
37
|
+
1. Confirm code is generated: `dawn strategy code <id> status`.
|
|
38
|
+
2. For live runs, check funding: `dawn account fund`.
|
|
39
|
+
3. Launch: `dawn strategy launch <id> --budget <N>` (add `--live` for real funds).
|
|
40
|
+
4. Capture the returned `strategyId`.
|
|
41
|
+
5. Monitor: `dawn run status <id>`.
|
|
42
|
+
|
|
43
|
+
## Example flows
|
|
44
|
+
|
|
45
|
+
**Paper run:**
|
|
46
|
+
1. User: "Test my strategy with $100."
|
|
47
|
+
2. Run: `dawn strategy launch <id> --budget 100`
|
|
48
|
+
3. Capture `strategyId`.
|
|
49
|
+
4. Monitor with `dawn run status <id>`.
|
|
50
|
+
|
|
51
|
+
**Live run:**
|
|
52
|
+
1. User: "Go live with $500 for 24 hours."
|
|
53
|
+
2. Verify funding: `dawn account fund`.
|
|
54
|
+
3. Run: `dawn strategy launch <id> --budget 500 --live --hours 24`
|
|
55
|
+
4. Capture `strategyId`.
|
|
56
|
+
5. Monitor closely with `dawn run status <id>`.
|
|
57
|
+
|
|
58
|
+
## Notes
|
|
59
|
+
|
|
60
|
+
- Paper runs simulate trading without real funds — use these to test strategies first.
|
|
61
|
+
- Live runs execute real trades with real money — always confirm with the user before launching live.
|
|
62
|
+
- The `--budget` flag sets the USD allocation for the run.
|
|
63
|
+
- `--hours` sets a duration after which the run automatically stops.
|
|
64
|
+
- If no `--hours` is specified, the run continues until manually stopped.
|
|
65
|
+
|
|
66
|
+
## Required output
|
|
67
|
+
|
|
68
|
+
Always return:
|
|
69
|
+
- `conversationId`
|
|
70
|
+
- `strategyId` (from launch output)
|
|
71
|
+
- Run mode (paper or live)
|
|
72
|
+
- Budget allocated
|
|
73
|
+
|
|
74
|
+
## Related skills
|
|
75
|
+
|
|
76
|
+
- **dawn-strategy-code** — Ensure code is ready before launching.
|
|
77
|
+
- **dawn-account** — Check funding before live runs.
|
|
78
|
+
- **dawn-run-monitor** — Monitor the run after launch.
|
|
79
|
+
- **dawn-run-stop** — Stop the run when done.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-strategy-list
|
|
3
|
+
description: List all strategies on the Dawn platform. Use to find existing strategies, get conversationIds, or check what strategies have been created.
|
|
4
|
+
tags: [strategy]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# List strategies
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
List all strategies associated with the authenticated account. Useful for finding `conversationId`s, checking strategy states, or picking a strategy to operate on.
|
|
12
|
+
|
|
13
|
+
## Command
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dawn strategy list
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Workflow
|
|
20
|
+
|
|
21
|
+
1. Run `dawn strategy list` to see all strategies.
|
|
22
|
+
2. Identify the target strategy by name or description.
|
|
23
|
+
3. Use the `conversationId` for further operations (status, revise, launch, etc.).
|
|
24
|
+
|
|
25
|
+
## Example flows
|
|
26
|
+
|
|
27
|
+
**Find a strategy:**
|
|
28
|
+
1. User: "What strategies do I have?"
|
|
29
|
+
2. Run: `dawn strategy list`
|
|
30
|
+
3. Present: list of strategies with their IDs and states.
|
|
31
|
+
|
|
32
|
+
**Resume work on a strategy:**
|
|
33
|
+
1. User: "I want to check on my SOL momentum strategy."
|
|
34
|
+
2. Run: `dawn strategy list`
|
|
35
|
+
3. Find the matching strategy and its `conversationId`.
|
|
36
|
+
4. Run: `dawn strategy status <conversationId>` for full details.
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Each strategy has a unique `conversationId` used across all strategy commands.
|
|
41
|
+
- The list shows all strategies regardless of state (draft, running, stopped).
|
|
42
|
+
|
|
43
|
+
## Related skills
|
|
44
|
+
|
|
45
|
+
- **dawn-strategy-status** — Get full details for a specific strategy.
|
|
46
|
+
- **dawn-strategy-create** — Create a new strategy if none exist.
|
|
47
|
+
- **dawn-run-monitor** — Check runs for active strategies.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-strategy-positions
|
|
3
|
+
description: View current positions, holdings, and PnL for a strategy. Use for "what's my strategy holding", portfolio breakdown, or PnL checks.
|
|
4
|
+
tags: [strategy, monitoring]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Strategy positions
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
View the current positions, holdings, and profit/loss for an active or completed strategy run.
|
|
12
|
+
|
|
13
|
+
## Command
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# View positions for a strategy
|
|
17
|
+
dawn strategy positions <conversationId>
|
|
18
|
+
|
|
19
|
+
# View positions for a specific strategyId
|
|
20
|
+
dawn strategy positions <conversationId> --strategy-id <strategyId>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
1. Run `dawn strategy positions <conversationId>`.
|
|
26
|
+
2. Review holdings, entry prices, current prices, and PnL.
|
|
27
|
+
3. Use `--strategy-id` if the conversation has multiple strategy runs.
|
|
28
|
+
|
|
29
|
+
## Example flows
|
|
30
|
+
|
|
31
|
+
**Check holdings:**
|
|
32
|
+
1. User: "What is my strategy holding right now?"
|
|
33
|
+
2. Run: `dawn strategy positions <id>`
|
|
34
|
+
3. Present: asset positions, quantities, entry prices, current values, PnL.
|
|
35
|
+
|
|
36
|
+
**Compare across runs:**
|
|
37
|
+
1. User has launched multiple runs from the same conversation.
|
|
38
|
+
2. Run: `dawn run list` to find specific `strategyId`s.
|
|
39
|
+
3. Run: `dawn strategy positions <id> --strategy-id <strategyId>` for each.
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
|
|
43
|
+
- Positions are only available for strategies that have been launched.
|
|
44
|
+
- For paper runs, positions reflect simulated trades.
|
|
45
|
+
- Use alongside `dawn run status` for a complete monitoring picture.
|
|
46
|
+
|
|
47
|
+
## Related skills
|
|
48
|
+
|
|
49
|
+
- **dawn-run-monitor** — Check run status and logs alongside positions.
|
|
50
|
+
- **dawn-strategy-status** — Full strategy status including code and rules.
|
|
51
|
+
- **dawn-account** — Check overall account balances.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-strategy-revise
|
|
3
|
+
description: Send a revision to an existing strategy to iterate on its rules and behavior. Use when the user wants to change, adjust, or refine a strategy.
|
|
4
|
+
tags: [strategy]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Revise a strategy
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Send a plain-English revision to an existing strategy. Dawn's AI re-interprets the strategy with the new instructions and regenerates rules.
|
|
12
|
+
|
|
13
|
+
## Command
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dawn strategy revise <conversationId> "<revision text>"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Workflow
|
|
20
|
+
|
|
21
|
+
1. Confirm the `conversationId` for the target strategy.
|
|
22
|
+
2. Run `dawn strategy revise <conversationId> "<revision>"`.
|
|
23
|
+
3. Review updated rules: `dawn strategy rules <conversationId> list`.
|
|
24
|
+
4. Approve rules and regenerate code if satisfied.
|
|
25
|
+
|
|
26
|
+
## Example flows
|
|
27
|
+
|
|
28
|
+
**Adjust parameters:**
|
|
29
|
+
1. User: "Change the RSI threshold from 30 to 25."
|
|
30
|
+
2. Run: `dawn strategy revise <id> "Change RSI buy threshold from 30 to 25"`
|
|
31
|
+
3. Review updated rules.
|
|
32
|
+
|
|
33
|
+
**Add conditions:**
|
|
34
|
+
1. User: "Also add a stop loss at 5%."
|
|
35
|
+
2. Run: `dawn strategy revise <id> "Add a 5% stop loss"`
|
|
36
|
+
3. Review and approve new rules.
|
|
37
|
+
|
|
38
|
+
**Change assets:**
|
|
39
|
+
1. User: "Switch from SOL to ETH."
|
|
40
|
+
2. Run: `dawn strategy revise <id> "Change target asset from SOL to ETH"`
|
|
41
|
+
3. Review rules, approve, regenerate code.
|
|
42
|
+
|
|
43
|
+
## Tips
|
|
44
|
+
|
|
45
|
+
- Revisions are cumulative — Dawn remembers the conversation history.
|
|
46
|
+
- Be specific about what to change — "make it more aggressive" is less effective than "increase position size to 20% of portfolio."
|
|
47
|
+
- After revising, always review the updated rules before generating new code.
|
|
48
|
+
- If the strategy has drifted too far, consider creating a new one instead.
|
|
49
|
+
|
|
50
|
+
## Related skills
|
|
51
|
+
|
|
52
|
+
- **dawn-strategy-create** — Create a fresh strategy instead of revising.
|
|
53
|
+
- **dawn-strategy-rules** — Review and approve rules after revision.
|
|
54
|
+
- **dawn-strategy-code** — Regenerate code after rules are approved.
|
|
55
|
+
- **dawn-strategy-status** — Check current state before revising.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-strategy-rules
|
|
3
|
+
description: List, review, and approve strategy rules. Rules must be approved before code can be generated. Use when managing strategy governance.
|
|
4
|
+
tags: [strategy, governance]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Strategy rules
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Review and approve the rules that Dawn's AI generates for a strategy. All rules must be approved before code generation can begin.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# List all rules and their approval status
|
|
17
|
+
dawn strategy rules <conversationId> list
|
|
18
|
+
|
|
19
|
+
# Approve a single rule by index
|
|
20
|
+
dawn strategy rules <conversationId> approve <rule-index>
|
|
21
|
+
|
|
22
|
+
# Approve all rules at once
|
|
23
|
+
dawn strategy rules <conversationId> approve-all
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
1. Run `dawn strategy rules <conversationId> list` to see all rules.
|
|
29
|
+
2. Review each rule — does it match the user's intent?
|
|
30
|
+
3. If all rules look good: `dawn strategy rules <conversationId> approve-all`.
|
|
31
|
+
4. If a specific rule needs revision: use `dawn strategy revise` to adjust, then re-list.
|
|
32
|
+
5. Once all rules are approved, proceed to code generation.
|
|
33
|
+
|
|
34
|
+
## Example flows
|
|
35
|
+
|
|
36
|
+
**Quick approval:**
|
|
37
|
+
1. User: "Approve the rules and generate code."
|
|
38
|
+
2. Run: `dawn strategy rules <id> list` — review rules.
|
|
39
|
+
3. Run: `dawn strategy rules <id> approve-all`.
|
|
40
|
+
4. Run: `dawn strategy code <id> generate`.
|
|
41
|
+
|
|
42
|
+
**Selective approval:**
|
|
43
|
+
1. User: "Show me the rules."
|
|
44
|
+
2. Run: `dawn strategy rules <id> list`.
|
|
45
|
+
3. Present rules to user with index numbers.
|
|
46
|
+
4. User approves some, wants changes to others.
|
|
47
|
+
5. Approve the good ones: `dawn strategy rules <id> approve 0`, `dawn strategy rules <id> approve 2`.
|
|
48
|
+
6. Revise the strategy for the rest: `dawn strategy revise <id> "Change rule about..."`.
|
|
49
|
+
|
|
50
|
+
## Notes
|
|
51
|
+
|
|
52
|
+
- Rule indices are zero-based.
|
|
53
|
+
- All rules must be approved before `dawn strategy code generate` will work.
|
|
54
|
+
- After a revision, previously approved rules may be reset — re-check with `rules list`.
|
|
55
|
+
|
|
56
|
+
## Related skills
|
|
57
|
+
|
|
58
|
+
- **dawn-strategy-revise** — Revise the strategy if rules don't match intent.
|
|
59
|
+
- **dawn-strategy-code** — Generate code after all rules are approved.
|
|
60
|
+
- **dawn-strategy-status** — Check overall strategy state including rule status.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dawn-strategy-status
|
|
3
|
+
description: Check the full status of a strategy including conversation state, version, code generation, and active runs. Use to inspect strategy health or debug issues.
|
|
4
|
+
tags: [strategy, monitoring]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Strategy status
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Get the full status of a strategy — conversation state, current version, code generation progress, and any active runs. This is the go-to command for understanding where a strategy stands.
|
|
12
|
+
|
|
13
|
+
## Command
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dawn strategy status <conversationId>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Output includes
|
|
20
|
+
|
|
21
|
+
- Conversation state and history
|
|
22
|
+
- Current strategy version
|
|
23
|
+
- Code generation status (pending, generating, complete, failed)
|
|
24
|
+
- Active runs and their states
|
|
25
|
+
- Rule approval status
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
1. Run `dawn strategy status <conversationId>`.
|
|
30
|
+
2. Check code generation status — is code ready?
|
|
31
|
+
3. Check run status — is anything actively running?
|
|
32
|
+
4. Determine next action based on state.
|
|
33
|
+
|
|
34
|
+
## Decision tree
|
|
35
|
+
|
|
36
|
+
After checking status:
|
|
37
|
+
- **No rules approved** → `dawn strategy rules <id> approve-all`
|
|
38
|
+
- **Rules approved, no code** → `dawn strategy code <id> generate`
|
|
39
|
+
- **Code generating** → wait and re-check with `dawn strategy code <id> status`
|
|
40
|
+
- **Code ready, no run** → `dawn strategy launch <id> --budget <N>`
|
|
41
|
+
- **Run active** → `dawn run status <id>` for monitoring
|
|
42
|
+
- **Strategy needs changes** → `dawn strategy revise <id> "<text>"`
|
|
43
|
+
|
|
44
|
+
## Example flow
|
|
45
|
+
|
|
46
|
+
1. User: "What's the status of my strategy?"
|
|
47
|
+
2. Run: `dawn strategy list` to find the `conversationId` (if not known).
|
|
48
|
+
3. Run: `dawn strategy status <conversationId>`.
|
|
49
|
+
4. Present: current state, code status, run status, and recommended next step.
|
|
50
|
+
|
|
51
|
+
## Related skills
|
|
52
|
+
|
|
53
|
+
- **dawn-strategy-list** — Find the conversationId.
|
|
54
|
+
- **dawn-strategy-rules** — Approve rules if pending.
|
|
55
|
+
- **dawn-strategy-code** — Generate or check code.
|
|
56
|
+
- **dawn-run-monitor** — Monitor active runs in detail.
|