@iamramo/zanat-cli 0.1.0 → 0.2.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.
- package/README.md +40 -24
- package/dist/cli.js +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +23 -6
- package/dist/commands/init.js.map +1 -1
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -1,46 +1,62 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @iamramo/zanat-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI for Zanat - a skill hub for AI agents.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Zanat is a Git-backed skill registry that allows individuals, teams, and companies to manage AI agent skills together. It serves as a hub where skills can be discovered, installed, and versioned.
|
|
8
|
-
|
|
9
|
-
## Quick Start
|
|
5
|
+
## Installation
|
|
10
6
|
|
|
11
7
|
```bash
|
|
12
|
-
# Install globally
|
|
13
8
|
npm install -g @iamramo/zanat-cli
|
|
9
|
+
```
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Initialize
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
16
|
zanat init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This will interactively prompt you for:
|
|
20
|
+
|
|
21
|
+
- Hub repository URL (default: https://github.com/iamramo/zanat-hub.git)
|
|
22
|
+
- Hub branch (default: main, falls back to master if main doesn't exist)
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
### Sync with Hub
|
|
25
|
+
|
|
26
|
+
```bash
|
|
19
27
|
zanat sync
|
|
28
|
+
```
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
zanat install yurchi/code-review
|
|
30
|
+
### Search Skills
|
|
23
31
|
|
|
24
|
-
|
|
25
|
-
zanat
|
|
32
|
+
```bash
|
|
33
|
+
zanat search [query]
|
|
26
34
|
```
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
### Install a Skill
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
zanat install <source>/<skill-name>
|
|
40
|
+
```
|
|
29
41
|
|
|
30
|
-
|
|
42
|
+
### List Installed Skills
|
|
31
43
|
|
|
32
44
|
```bash
|
|
33
|
-
|
|
45
|
+
zanat list
|
|
34
46
|
```
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
Configuration is stored in `~/.zanat/config.json` and is created during `zanat init`.
|
|
37
51
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
You can manually edit this file to change settings:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"hubUrl": "https://github.com/iamramo/zanat-hub.git",
|
|
57
|
+
"hubBranch": "main"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
44
60
|
|
|
45
61
|
## License
|
|
46
62
|
|
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ import { syncCommand } from './commands/sync.js';
|
|
|
4
4
|
import { installCommand } from './commands/install.js';
|
|
5
5
|
import { listCommand } from './commands/list.js';
|
|
6
6
|
import { searchCommand } from './commands/search.js';
|
|
7
|
-
program.name('zanat').description('A skill hub for AI agents').version('0.1
|
|
7
|
+
program.name('zanat').description('A skill hub for AI agents').version('0.2.1');
|
|
8
8
|
program
|
|
9
9
|
.command('init')
|
|
10
10
|
.description('Initialize zanat configuration and clone the hub')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,QAAa,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,QAAa,OAAO,CAAC,IAAI,CAqDhD,CAAC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
|
-
import { ZANAT_DIR, HUB_DIR, AGENTS_DIR, saveConfig,
|
|
1
|
+
import { ZANAT_DIR, HUB_DIR, AGENTS_DIR, saveConfig, cloneHub, isHubCloned, } from '@iamramo/zanat-core';
|
|
2
|
+
import { input } from '@inquirer/prompts';
|
|
2
3
|
import fs from 'fs-extra';
|
|
3
4
|
import chalk from 'chalk';
|
|
4
5
|
export const initCommand = async () => {
|
|
5
|
-
console.log(chalk.blue('Initializing Zanat
|
|
6
|
+
console.log(chalk.blue('Initializing Zanat...\n'));
|
|
6
7
|
try {
|
|
8
|
+
const hubUrl = await input({
|
|
9
|
+
message: 'Hub repository URL:',
|
|
10
|
+
default: 'https://github.com/iamramo/zanat-hub.git',
|
|
11
|
+
});
|
|
12
|
+
const hubBranch = await input({
|
|
13
|
+
message: 'Hub branch:',
|
|
14
|
+
default: 'main',
|
|
15
|
+
});
|
|
16
|
+
console.log(chalk.blue('\nSetting up directories...'));
|
|
7
17
|
await fs.ensureDir(ZANAT_DIR);
|
|
8
18
|
console.log(chalk.green(`✓ Created ${ZANAT_DIR}`));
|
|
9
|
-
const config =
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
const config = {
|
|
20
|
+
hubUrl,
|
|
21
|
+
hubBranch,
|
|
22
|
+
};
|
|
12
23
|
await fs.ensureDir(AGENTS_DIR);
|
|
13
24
|
const hubExists = await isHubCloned();
|
|
14
25
|
if (!hubExists) {
|
|
15
26
|
console.log(chalk.blue('Cloning hub repository...'));
|
|
16
|
-
await cloneHub(
|
|
27
|
+
const actualBranch = await cloneHub(hubUrl, hubBranch);
|
|
28
|
+
if (actualBranch !== hubBranch) {
|
|
29
|
+
config.hubBranch = actualBranch;
|
|
30
|
+
console.log(chalk.yellow(`⚠ Branch '${hubBranch}' not found, using '${actualBranch}' instead`));
|
|
31
|
+
}
|
|
17
32
|
console.log(chalk.green(`✓ Cloned hub to ${HUB_DIR}`));
|
|
18
33
|
}
|
|
19
34
|
else {
|
|
20
35
|
console.log(chalk.yellow('Hub already exists, skipping clone'));
|
|
21
36
|
}
|
|
37
|
+
await saveConfig(config);
|
|
38
|
+
console.log(chalk.green(`✓ Created config`));
|
|
22
39
|
console.log(chalk.green('\n✨ Zanat initialized successfully!'));
|
|
23
40
|
console.log(chalk.gray(`\nNext steps:`));
|
|
24
41
|
console.log(chalk.gray(` zanat sync - Update skills from hub`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,UAAU,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,IAAmB,EAAE;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAEnD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC;YACzB,OAAO,EAAE,qBAAqB;YAC9B,OAAO,EAAE,0CAA0C;SACpD,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC;YAC5B,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,MAAM;SAChB,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC;QAEvD,MAAM,EAAE,C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AAC,CAAC,CAAC;QACxE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC,CAAC;QACvE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC,CAAC;IACnE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iamramo/zanat-cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "CLI for zanat - a skill hub for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli.js",
|
|
@@ -27,17 +27,18 @@
|
|
|
27
27
|
"typecheck": "tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@iamramo/zanat-core": "
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
30
|
+
"@iamramo/zanat-core": "^0.2.0",
|
|
31
|
+
"@inquirer/prompts": "^8.3.2",
|
|
32
|
+
"chalk": "^5.6.2",
|
|
33
|
+
"commander": "^14.0.3",
|
|
34
|
+
"fs-extra": "^11.3.4",
|
|
34
35
|
"zod": "^4.3.6"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@types/fs-extra": "^11.0.4",
|
|
38
|
-
"@types/node": "^
|
|
39
|
-
"tsx": "^4.
|
|
40
|
-
"typescript": "^5.
|
|
39
|
+
"@types/node": "^25.5.0",
|
|
40
|
+
"tsx": "^4.21.0",
|
|
41
|
+
"typescript": "^5.9.3"
|
|
41
42
|
},
|
|
42
43
|
"engines": {
|
|
43
44
|
"node": ">=22.0.0"
|