@neo4j-labs/cli 0.0.0-bootstrap.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 +77 -0
- package/bin/neo4j-cli.js +62 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# @neo4j-labs/cli
|
|
2
|
+
|
|
3
|
+
The Neo4j command-line tool, distributed as a prebuilt native binary via npm.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i -g @neo4j-labs/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This installs a small Node wrapper plus one platform-specific package
|
|
12
|
+
containing the prebuilt `neo4j-cli` binary for your OS and CPU. npm picks the
|
|
13
|
+
matching platform package automatically — there is no postinstall script and
|
|
14
|
+
no source build.
|
|
15
|
+
|
|
16
|
+
After install, `neo4j-cli` is on your `PATH`:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
neo4j-cli --help
|
|
20
|
+
neo4j-cli aura instance list --output table
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`pnpm add -g @neo4j-labs/cli` and `yarn global add @neo4j-labs/cli` work the same way.
|
|
24
|
+
|
|
25
|
+
## Supported platforms
|
|
26
|
+
|
|
27
|
+
| OS | CPU |
|
|
28
|
+
| --------- | ------- |
|
|
29
|
+
| `darwin` | `arm64` |
|
|
30
|
+
| `darwin` | `x64` |
|
|
31
|
+
| `linux` | `arm64` |
|
|
32
|
+
| `linux` | `ia32` |
|
|
33
|
+
| `linux` | `x64` |
|
|
34
|
+
| `win32` | `arm64` |
|
|
35
|
+
| `win32` | `ia32` |
|
|
36
|
+
| `win32` | `x64` |
|
|
37
|
+
|
|
38
|
+
If your platform is in the table above but the wrapper still complains that no
|
|
39
|
+
prebuilt binary was found, your install probably ran with `--no-optional` or
|
|
40
|
+
`--omit=optional`. Reinstall without that flag — the per-platform binary lives
|
|
41
|
+
in an `optionalDependencies` entry, so excluding optionals also excludes the
|
|
42
|
+
binary.
|
|
43
|
+
|
|
44
|
+
If your platform is not in the table, `npm i -g @neo4j-labs/cli` will still
|
|
45
|
+
succeed (the platform packages are optional), but invoking `neo4j-cli` will
|
|
46
|
+
print a friendly error naming the detected platform and arch. Download a
|
|
47
|
+
prebuilt binary directly from
|
|
48
|
+
[GitHub Releases](https://github.com/neo4j-labs/neo4j-cli/releases/latest)
|
|
49
|
+
or build from source.
|
|
50
|
+
|
|
51
|
+
## Release channels
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
npm i -g @neo4j-labs/cli # latest stable
|
|
55
|
+
npm i -g @neo4j-labs/cli@alpha # alpha prerelease
|
|
56
|
+
npm i -g @neo4j-labs/cli@beta # beta prerelease
|
|
57
|
+
npm i -g @neo4j-labs/cli@rc # release candidate
|
|
58
|
+
npm i -g @neo4j-labs/cli@next # any other prerelease (e.g. snapshot, dev)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The dist-tag is picked from the version string at publish time:
|
|
62
|
+
`X.Y.Z-alpha*` → `alpha`, `X.Y.Z-beta*` → `beta`, `X.Y.Z-rc*` → `rc`, any
|
|
63
|
+
other `-`-suffixed version → `next`, plain `X.Y.Z` → `latest`.
|
|
64
|
+
|
|
65
|
+
## Documentation and feedback
|
|
66
|
+
|
|
67
|
+
- Project repo and full docs:
|
|
68
|
+
https://github.com/neo4j-labs/neo4j-cli
|
|
69
|
+
- Issue tracker:
|
|
70
|
+
https://github.com/neo4j-labs/neo4j-cli/issues
|
|
71
|
+
- Aura CLI usage guide:
|
|
72
|
+
https://github.com/neo4j-labs/neo4j-cli/blob/main/docs/usageGuide/A%20Guide%20To%20The%20New%20Aura%20CLI.md
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
Apache-2.0. See the project repo for the full license text and third-party
|
|
77
|
+
notices.
|
package/bin/neo4j-cli.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Wrapper bin shim for @neo4j-labs/cli.
|
|
3
|
+
//
|
|
4
|
+
// Resolves the platform-specific package (@neo4j-labs/cli-<os>-<arch>) at runtime via
|
|
5
|
+
// require.resolve, then execs the binary with full stdio/signal/exit-code passthrough.
|
|
6
|
+
// The platform pkgs are listed in @neo4j-labs/cli's optionalDependencies so npm only
|
|
7
|
+
// installs the one matching the current platform/arch.
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const { spawnSync } = require('child_process');
|
|
12
|
+
|
|
13
|
+
const SUPPORTED = [
|
|
14
|
+
'darwin-arm64',
|
|
15
|
+
'darwin-x64',
|
|
16
|
+
'linux-arm64',
|
|
17
|
+
'linux-ia32',
|
|
18
|
+
'linux-x64',
|
|
19
|
+
'win32-arm64',
|
|
20
|
+
'win32-ia32',
|
|
21
|
+
'win32-x64',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const platform = process.platform;
|
|
25
|
+
const arch = process.arch;
|
|
26
|
+
const key = platform + '-' + arch;
|
|
27
|
+
const exeSuffix = platform === 'win32' ? '.exe' : '';
|
|
28
|
+
const pkgName = '@neo4j-labs/cli-' + key;
|
|
29
|
+
const binSpecifier = pkgName + '/bin/neo4j-cli' + exeSuffix;
|
|
30
|
+
|
|
31
|
+
let binary;
|
|
32
|
+
try {
|
|
33
|
+
binary = require.resolve(binSpecifier);
|
|
34
|
+
} catch (err) {
|
|
35
|
+
const supportedList = SUPPORTED.map((s) => ' - ' + s).join('\n');
|
|
36
|
+
process.stderr.write(
|
|
37
|
+
'neo4j-cli: no prebuilt binary found for platform "' + key + '".\n' +
|
|
38
|
+
'\n' +
|
|
39
|
+
'Supported platforms:\n' +
|
|
40
|
+
supportedList +
|
|
41
|
+
'\n' +
|
|
42
|
+
'\n' +
|
|
43
|
+
'If your platform is in the list above, the platform package "' +
|
|
44
|
+
pkgName +
|
|
45
|
+
'"\nwas not installed. This typically happens when npm/pnpm/yarn was invoked\n' +
|
|
46
|
+
'with --no-optional or --omit=optional. Reinstall without that flag.\n' +
|
|
47
|
+
'\n' +
|
|
48
|
+
'If your platform is NOT in the list, it is not currently supported.\n' +
|
|
49
|
+
'Download a prebuilt binary from https://github.com/neo4j/cli/releases\n' +
|
|
50
|
+
'or build from source.\n',
|
|
51
|
+
);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
56
|
+
|
|
57
|
+
if (result.error) {
|
|
58
|
+
process.stderr.write('neo4j-cli: failed to spawn binary: ' + result.error.message + '\n');
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@neo4j-labs/cli",
|
|
3
|
+
"version": "0.0.0-bootstrap.1",
|
|
4
|
+
"description": "Neo4j command-line tool (super-CLI). Installs the right prebuilt binary for your platform.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://github.com/neo4j-labs/neo4j-cli",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/neo4j-labs/neo4j-cli.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/neo4j-labs/neo4j-cli/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"neo4j-cli": "bin/neo4j-cli.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"bin/neo4j-cli.js",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"optionalDependencies": {
|
|
25
|
+
"@neo4j-labs/cli-darwin-arm64": "0.0.0-bootstrap.1",
|
|
26
|
+
"@neo4j-labs/cli-darwin-x64": "0.0.0-bootstrap.1",
|
|
27
|
+
"@neo4j-labs/cli-linux-arm64": "0.0.0-bootstrap.1",
|
|
28
|
+
"@neo4j-labs/cli-linux-ia32": "0.0.0-bootstrap.1",
|
|
29
|
+
"@neo4j-labs/cli-linux-x64": "0.0.0-bootstrap.1",
|
|
30
|
+
"@neo4j-labs/cli-win32-arm64": "0.0.0-bootstrap.1",
|
|
31
|
+
"@neo4j-labs/cli-win32-ia32": "0.0.0-bootstrap.1",
|
|
32
|
+
"@neo4j-labs/cli-win32-x64": "0.0.0-bootstrap.1"
|
|
33
|
+
}
|
|
34
|
+
}
|