nanocorp 0.0.2 → 0.1.0
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 +61 -1
- package/bin/nanocorp.js +27 -0
- package/bin/resolve.js +22 -0
- package/package.json +30 -3
- package/scripts/postinstall.js +21 -0
- package/vendor/nanocorp-darwin-amd64 +0 -0
- package/vendor/nanocorp-darwin-arm64 +0 -0
- package/vendor/nanocorp-linux-amd64 +0 -0
- package/vendor/nanocorp-linux-arm64 +0 -0
package/README.md
CHANGED
|
@@ -1,2 +1,62 @@
|
|
|
1
1
|
# nanocorp
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
The **NanoCorp CLI**: create and run your autonomous company from the terminal.
|
|
4
|
+
|
|
5
|
+
Enable Claude Code,Codex or any local agent to take your localhost project and make it a company generating revenues.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i -g nanocorp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
nanocorp login # sign in (opens your browser; falls back to a device code)
|
|
17
|
+
nanocorp init --name acme --one-liner "AI for vets" # create + clone a company
|
|
18
|
+
nanocorp --help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For a one-off invocation without a global install:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npx nanocorp --help
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Supported platforms
|
|
28
|
+
|
|
29
|
+
macOS and Linux on `x64` (Intel/AMD) and `arm64` (Apple Silicon / ARM). All four
|
|
30
|
+
prebuilt binaries ship inside the package and a small launcher picks the right one
|
|
31
|
+
at runtime, so there is no install-time download. Windows is not supported yet;
|
|
32
|
+
npm reports a clean `EBADPLATFORM` there.
|
|
33
|
+
|
|
34
|
+
## Agent skills
|
|
35
|
+
|
|
36
|
+
The CLI bundles a set of `nanocorp-*` agent skills (Claude-Code-style `SKILL.md`
|
|
37
|
+
files) that teach a coding agent how to drive each primitive. On install they are
|
|
38
|
+
written into the agent skill directories you already have (`~/.claude/skills/`,
|
|
39
|
+
`~/.agents/skills/`); directories that do not exist are left untouched, so a
|
|
40
|
+
non-agent setup is unaffected.
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
nanocorp skills list # show the bundled skills
|
|
44
|
+
nanocorp skills install # (re)install them into ~/.claude/skills etc.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Set `NANOCORP_NO_AGENT_SKILLS=1` to opt out of the automatic install.
|
|
48
|
+
|
|
49
|
+
## Heads up: commands act on your real company
|
|
50
|
+
|
|
51
|
+
By default the CLI talks to the **production** backend, so commands take **real**
|
|
52
|
+
actions (real emails, real products, real charges) on your own company, scoped to
|
|
53
|
+
your own login. That is the intended behavior. There is nothing to act on until
|
|
54
|
+
you create a company with `nanocorp init`.
|
|
55
|
+
|
|
56
|
+
## Docs
|
|
57
|
+
|
|
58
|
+
Full documentation: https://docs.nanocorp.so
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
Proprietary. Distributed as compiled binaries only (`UNLICENSED`).
|
package/bin/nanocorp.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
const { join } = require("node:path");
|
|
5
|
+
const fs = require("node:fs");
|
|
6
|
+
const { resolveBinaryName } = require("./resolve");
|
|
7
|
+
|
|
8
|
+
const name = resolveBinaryName(process.platform, process.arch);
|
|
9
|
+
if (!name) {
|
|
10
|
+
console.error(
|
|
11
|
+
`nanocorp: unsupported platform ${process.platform}/${process.arch}. ` +
|
|
12
|
+
`Supported: darwin and linux on x64/arm64.`
|
|
13
|
+
);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
const bin = join(__dirname, "..", "vendor", name);
|
|
17
|
+
try {
|
|
18
|
+
fs.chmodSync(bin, 0o755);
|
|
19
|
+
} catch {
|
|
20
|
+
/* best effort: npm does not reliably preserve +x on vendored files */
|
|
21
|
+
}
|
|
22
|
+
const res = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
23
|
+
if (res.error) {
|
|
24
|
+
console.error(`nanocorp: ${res.error.message}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
process.exit(res.status === null ? 1 : res.status);
|
package/bin/resolve.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// ARCH maps Node's process.arch to the GOARCH suffix used by the release build.
|
|
4
|
+
const ARCH = { x64: "amd64", arm64: "arm64" };
|
|
5
|
+
|
|
6
|
+
// resolveBinaryName maps a Node (platform, arch) pair to the vendored binary
|
|
7
|
+
// name, or returns null for an unsupported platform. The returned name must stay
|
|
8
|
+
// in lockstep with three things:
|
|
9
|
+
// 1. what `make build-cli-release` emits: nanocorp-<GOOS>-<GOARCH>;
|
|
10
|
+
// 2. the four binaries CI copies into vendor/ before publish;
|
|
11
|
+
// 3. the `os`/`cpu` gates in package.json (what npm will let install).
|
|
12
|
+
// resolve.test.js asserts that parity, so a future change (windows support,
|
|
13
|
+
// optional-deps) has to update every side together.
|
|
14
|
+
function resolveBinaryName(platform, arch) {
|
|
15
|
+
const goarch = ARCH[arch];
|
|
16
|
+
if ((platform !== "darwin" && platform !== "linux") || !goarch) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return `nanocorp-${platform}-${goarch}`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = { resolveBinaryName, ARCH };
|
package/package.json
CHANGED
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nanocorp",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "NanoCorp CLI: create and run your autonomous company from the terminal.",
|
|
5
|
+
"homepage": "https://nanocorp.so",
|
|
6
|
+
"bin": {
|
|
7
|
+
"nanocorp": "bin/nanocorp.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"vendor/",
|
|
12
|
+
"scripts/",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"postinstall": "node scripts/postinstall.js",
|
|
17
|
+
"test": "node --test"
|
|
18
|
+
},
|
|
19
|
+
"os": [
|
|
20
|
+
"darwin",
|
|
21
|
+
"linux"
|
|
22
|
+
],
|
|
23
|
+
"cpu": [
|
|
24
|
+
"x64",
|
|
25
|
+
"arm64"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
5
30
|
"license": "UNLICENSED",
|
|
6
|
-
"
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
7
34
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// Best-effort: install the bundled NanoCorp agent skills into a coding agent's
|
|
4
|
+
// skill directories (the same thing install.sh does for the team channel). The
|
|
5
|
+
// CLI honors NANOCORP_NO_AGENT_SKILLS and no-ops when no agent dir is present, so
|
|
6
|
+
// this never fails the npm install. When this hook is skipped (--ignore-scripts,
|
|
7
|
+
// pnpm, ...), the CLI installs them on first run instead (see cmd/root.go).
|
|
8
|
+
try {
|
|
9
|
+
if (!process.env.NANOCORP_NO_AGENT_SKILLS) {
|
|
10
|
+
const { spawnSync } = require("node:child_process");
|
|
11
|
+
const { join } = require("node:path");
|
|
12
|
+
spawnSync(
|
|
13
|
+
process.execPath,
|
|
14
|
+
[join(__dirname, "..", "bin", "nanocorp.js"), "skills", "install", "--quiet"],
|
|
15
|
+
{ stdio: "ignore", timeout: 15000 }
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
} catch {
|
|
19
|
+
/* swallow: install must succeed regardless */
|
|
20
|
+
}
|
|
21
|
+
process.exit(0);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|