@atollhq/skill-codex 0.1.6 → 0.1.8
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 +6 -5
- package/bin/install.mjs +30 -16
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,16 +7,17 @@ Gives your Codex agent the ability to manage tasks, goals, KPIs, initiatives, mi
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx @atollhq/skill-codex --key sk_atoll_... --org your-org-
|
|
10
|
+
npx @atollhq/skill-codex --key sk_atoll_... --org your-org-id
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Get an API key from **Settings > Members > Add Agent** (or **Create API Key** for integrations) in the Atoll app.
|
|
14
14
|
|
|
15
|
-
This does
|
|
15
|
+
This does four things:
|
|
16
16
|
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
19
|
-
3.
|
|
17
|
+
1. Installs the `atoll-api` skill to `~/.codex/skills/atoll-api/`
|
|
18
|
+
2. Appends (or updates) an `# Atoll Integration` section in `~/.codex/AGENTS.md`
|
|
19
|
+
3. Copies API reference files to `~/.codex/atoll-references/`
|
|
20
|
+
4. Appends `ATOLL_API_KEY` and `ATOLL_ORG_ID` exports to your shell profile (`~/.zshrc` or `~/.bashrc`)
|
|
20
21
|
|
|
21
22
|
Open a fresh shell (or `source` your profile) and Codex has the Atoll integration.
|
|
22
23
|
|
package/bin/install.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync, copyFileSync } from 'node:fs'
|
|
3
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync, copyFileSync } from 'node:fs'
|
|
4
4
|
import { join, dirname } from 'node:path'
|
|
5
5
|
import { homedir } from 'node:os'
|
|
6
6
|
import { fileURLToPath } from 'node:url'
|
|
@@ -19,16 +19,17 @@ function parseArgs(argv) {
|
|
|
19
19
|
|
|
20
20
|
function printUsage() {
|
|
21
21
|
console.log(`
|
|
22
|
-
Usage: npx @atollhq/skill-codex --key <api-key> --org <org-
|
|
22
|
+
Usage: npx @atollhq/skill-codex --key <api-key> --org <org-id>
|
|
23
23
|
|
|
24
24
|
Options:
|
|
25
25
|
--key Atoll API key (sk_atoll_...)
|
|
26
|
-
--org Organization
|
|
26
|
+
--org Organization ID
|
|
27
27
|
--help Show this help message
|
|
28
28
|
|
|
29
29
|
Installs the Atoll integration for Codex CLI:
|
|
30
|
+
- Installs the atoll-api skill to ~/.codex/skills/atoll-api/
|
|
30
31
|
- Writes AGENTS.md with API reference to ~/.codex/
|
|
31
|
-
- Sets ATOLL_API_KEY and
|
|
32
|
+
- Sets ATOLL_API_KEY and ATOLL_ORG_ID env vars
|
|
32
33
|
`)
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -47,11 +48,17 @@ if (!args.key.startsWith('sk_atoll_')) {
|
|
|
47
48
|
process.exit(1)
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
// 1.
|
|
51
|
+
// 1. Install the Codex skill to ~/.codex/skills/atoll-api/
|
|
51
52
|
const codexDir = join(homedir(), '.codex')
|
|
52
53
|
mkdirSync(codexDir, { recursive: true })
|
|
53
54
|
|
|
54
55
|
const skillDir = join(__dirname, '..', 'skill')
|
|
56
|
+
const skillDest = join(codexDir, 'skills', 'atoll-api')
|
|
57
|
+
mkdirSync(skillDest, { recursive: true })
|
|
58
|
+
cpSync(skillDir, skillDest, { recursive: true })
|
|
59
|
+
console.log(`Installed Atoll skill to ${skillDest}`)
|
|
60
|
+
|
|
61
|
+
// 2. Write AGENTS.md to ~/.codex/
|
|
55
62
|
const skillMd = readFileSync(join(skillDir, 'SKILL.md'), 'utf-8')
|
|
56
63
|
// Strip YAML frontmatter for AGENTS.md
|
|
57
64
|
const body = skillMd.replace(/^---[\s\S]*?---\n*/, '')
|
|
@@ -63,7 +70,7 @@ ${body}
|
|
|
63
70
|
## Credentials
|
|
64
71
|
|
|
65
72
|
- API Key: set as ATOLL_API_KEY environment variable
|
|
66
|
-
- Org: ${args.org}
|
|
73
|
+
- Org ID: ${args.org}
|
|
67
74
|
`
|
|
68
75
|
|
|
69
76
|
const agentsPath = join(codexDir, 'AGENTS.md')
|
|
@@ -82,7 +89,7 @@ if (existsSync(agentsPath)) {
|
|
|
82
89
|
}
|
|
83
90
|
console.log(`Wrote Atoll instructions to ${agentsPath}`)
|
|
84
91
|
|
|
85
|
-
//
|
|
92
|
+
// 3. Copy reference files for compatibility with older installs
|
|
86
93
|
const refsDir = join(codexDir, 'atoll-references')
|
|
87
94
|
mkdirSync(refsDir, { recursive: true })
|
|
88
95
|
for (const file of ['api-endpoints.md', 'api-fields.md']) {
|
|
@@ -90,25 +97,32 @@ for (const file of ['api-endpoints.md', 'api-fields.md']) {
|
|
|
90
97
|
}
|
|
91
98
|
console.log(`Copied API references to ${refsDir}`)
|
|
92
99
|
|
|
93
|
-
//
|
|
100
|
+
// 4. Set env vars in shell profile
|
|
94
101
|
const shell = process.env.SHELL || '/bin/bash'
|
|
95
102
|
const profilePath = shell.includes('zsh')
|
|
96
103
|
? join(homedir(), '.zshrc')
|
|
97
104
|
: join(homedir(), '.bashrc')
|
|
98
105
|
|
|
99
|
-
|
|
106
|
+
function upsertExport(profile, name, value) {
|
|
107
|
+
const line = `export ${name}="${value}"`
|
|
108
|
+
const pattern = new RegExp(`^export ${name}=.*$`, 'm')
|
|
109
|
+
if (pattern.test(profile)) return profile.replace(pattern, line)
|
|
110
|
+
return `${profile.trimEnd()}\n${line}\n`
|
|
111
|
+
}
|
|
100
112
|
|
|
101
113
|
if (existsSync(profilePath)) {
|
|
102
|
-
|
|
103
|
-
if (profile.includes('
|
|
104
|
-
|
|
105
|
-
} else {
|
|
106
|
-
writeFileSync(profilePath, profile.trimEnd() + '\n' + envBlock)
|
|
107
|
-
console.log(`Added ATOLL_API_KEY and ATOLL_ORG_SLUG to ${profilePath}`)
|
|
114
|
+
let profile = readFileSync(profilePath, 'utf-8')
|
|
115
|
+
if (!profile.includes('# Atoll (added by @atollhq/skill-codex)')) {
|
|
116
|
+
profile = `${profile.trimEnd()}\n\n# Atoll (added by @atollhq/skill-codex)\n`
|
|
108
117
|
}
|
|
118
|
+
profile = upsertExport(profile, 'ATOLL_API_KEY', args.key)
|
|
119
|
+
profile = upsertExport(profile, 'ATOLL_ORG_ID', args.org)
|
|
120
|
+
writeFileSync(profilePath, profile)
|
|
121
|
+
console.log(`Configured ATOLL_API_KEY and ATOLL_ORG_ID in ${profilePath}`)
|
|
109
122
|
} else {
|
|
123
|
+
const envBlock = `\n# Atoll (added by @atollhq/skill-codex)\nexport ATOLL_API_KEY="${args.key}"\nexport ATOLL_ORG_ID="${args.org}"\n`
|
|
110
124
|
writeFileSync(profilePath, envBlock)
|
|
111
|
-
console.log(`Created ${profilePath} with ATOLL_API_KEY and
|
|
125
|
+
console.log(`Created ${profilePath} with ATOLL_API_KEY and ATOLL_ORG_ID`)
|
|
112
126
|
}
|
|
113
127
|
|
|
114
128
|
console.log(`\nDone! Restart your shell, then Codex will have access to the Atoll API.`)
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atollhq/skill-codex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Install the Atoll project management integration for Codex CLI",
|
|
5
5
|
"bin": {
|
|
6
|
-
"skill-codex": "
|
|
6
|
+
"skill-codex": "bin/install.mjs"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"bin/",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/atollhq/atoll.git",
|
|
21
|
+
"url": "git+https://github.com/atollhq/atoll.git",
|
|
22
22
|
"directory": "packages/skill-codex"
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|