mirror of
https://github.com/expo/agent-cli-detector.git
synced 2026-11-15 12:48:16 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88a2e447d2 | ||
|
|
e711d0ed0f |
No files matched your search
@@ -6,6 +6,8 @@ The package is designed around small detection strategies and data-driven agent
|
||||
|
||||
## Install
|
||||
|
||||
Install from npm:
|
||||
|
||||
```sh
|
||||
npm install agent-cli-detector
|
||||
```
|
||||
@@ -34,8 +36,15 @@ if (isRunningFromAgent()) {
|
||||
## CLI usage
|
||||
|
||||
```sh
|
||||
npx detect-agent
|
||||
npx detect-agent --json
|
||||
npx agent-cli-detector
|
||||
npx agent-cli-detector --json
|
||||
```
|
||||
|
||||
After installing the package, the CLI command is available as `detect-agent`:
|
||||
|
||||
```sh
|
||||
detect-agent
|
||||
detect-agent --json
|
||||
```
|
||||
|
||||
Exit codes:
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "agent-cli-detector",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "agent-cli-detector",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"detect-agent": "dist/cli.js"
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "agent-cli-detector",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Detect whether a JavaScript CLI is running inside a coding agent.",
|
||||
"type": "module",
|
||||
"sideEffects": false,
|
||||
"bin": {
|
||||
"detect-agent": "./dist/cli.js"
|
||||
"detect-agent": "dist/cli.js"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"node": ">=18.18"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"build": "tsc -p tsconfig.json && node -e \"require('node:fs').chmodSync('dist/cli.js', 0o755)\"",
|
||||
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
||||
"test": "npm run build && node --test test/*.test.mjs",
|
||||
"prepack": "npm run clean && npm test"
|
||||
|
||||
Reference in new issue
Block a user