|
| 1 | +<!-- |
| 2 | + GENERATED. This repository is produced from the searchcode.ai customer API contract. |
| 3 | + Edits here are overwritten on the next contract change — open an issue instead. |
| 4 | +--> |
| 5 | + |
| 6 | +# @searchcode/cli |
| 7 | + |
| 8 | +[](https://www.npmjs.com/package/@searchcode/cli) [](./LICENSE) |
| 9 | + |
| 10 | +Search the source code of the public web from your terminal. Find every site running a library, |
| 11 | +embedding an endpoint, or carrying a tracking id — then look up what any of those domains is |
| 12 | +built with. |
| 13 | + |
| 14 | +Powered by [searchcode.ai](https://searchcode.ai). |
| 15 | + |
| 16 | +## Install |
| 17 | + |
| 18 | +```bash |
| 19 | +npm install -g @searchcode/cli |
| 20 | +``` |
| 21 | + |
| 22 | +Or run it without installing: |
| 23 | + |
| 24 | +```bash |
| 25 | +npx @searchcode/cli search --q "js.stripe.com/v3" |
| 26 | +``` |
| 27 | + |
| 28 | +## Set up |
| 29 | + |
| 30 | +```bash |
| 31 | +export SEARCHCODE_API_KEY="your-key" |
| 32 | +``` |
| 33 | + |
| 34 | +[Get a key](https://searchcode.ai/). The free plan needs no card, and |
| 35 | +[free source search in the browser](https://searchcode.ai/) needs no account at all. |
| 36 | + |
| 37 | +## Examples |
| 38 | + |
| 39 | +```bash |
| 40 | +# every site embedding the Stripe v3 script |
| 41 | +searchcode search --q "js.stripe.com/v3" |
| 42 | + |
| 43 | +# narrow to one top-level domain, as raw JSON |
| 44 | +searchcode search --q "js.stripe.com/v3" --tld de --json |
| 45 | + |
| 46 | +# what is this domain built with? |
| 47 | +searchcode profile --domain example.com |
| 48 | + |
| 49 | +# how many sites use React? |
| 50 | +searchcode count --kind tech --signal React |
| 51 | +``` |
| 52 | + |
| 53 | +## Commands |
| 54 | + |
| 55 | +| Command | Credits | Plan | What it does | |
| 56 | +| --- | --- | --- | --- | |
| 57 | +| `search` | 5 | Free | Search the source code of the public web | |
| 58 | +| `count` | 1 | Free | Count the sites carrying one signal | |
| 59 | +| `tech-sites` | 3 | Free | List every site using a technology | |
| 60 | +| `export` | 5 | Solo | Export matching domains in bulk | |
| 61 | +| `profile` | 3 | Pro | Show what one domain is built with | |
| 62 | +| `read` | 5 | Pro | Read the retained source behind a search hit | |
| 63 | +| `owner` | 5 | Pro | Find domains sharing a tracking identifier | |
| 64 | +| `domains` | 1 | Free | Browse the ranked domain index | |
| 65 | +| `shops` | 1 | Enterprise | Browse captured e-commerce storefronts | |
| 66 | +| `shop-stats` | 1 | Enterprise | Aggregate statistics over the shop catalog | |
| 67 | +| `products` | 2 | Enterprise | Read captured product records | |
| 68 | +| `shops-discover` | 1 | Enterprise | Discover storefronts with resumable paging | |
| 69 | +| `catalog` | 2 | Enterprise | Read a store catalog page by page | |
| 70 | +| `catalog-doc` | 2 | Enterprise | Fetch one catalog document | |
| 71 | + |
| 72 | +Run `searchcode <command> --help` for a command's arguments and flags. |
| 73 | + |
| 74 | +## Global flags |
| 75 | + |
| 76 | +| Flag | Effect | |
| 77 | +| --- | --- | |
| 78 | +| `--json` | print the raw API response instead of the readable rendering | |
| 79 | +| `--key` | override `SEARCHCODE_API_KEY` for one call | |
| 80 | +| `--help` | show help for the command, or the command list | |
| 81 | + |
| 82 | +## Exit codes |
| 83 | + |
| 84 | +| Code | Meaning | |
| 85 | +| --- | --- | |
| 86 | +| 0 | success | |
| 87 | +| 1 | the API returned an error (the message says what and why) | |
| 88 | +| 2 | your command was wrong: unknown command, missing argument, or no key | |
| 89 | + |
| 90 | +## How this repository is produced |
| 91 | + |
| 92 | +Every file here is generated from the searchcode.ai customer API contract. When the API changes, |
| 93 | +the contract changes, these packages are regenerated, their tests run, and a new version is |
| 94 | +published. That is why the commands, tools, credit costs and plan requirements documented here |
| 95 | +can never drift from what the API actually does. |
| 96 | + |
| 97 | +Found a problem? [Open an issue](https://github.com/searchcode-ai) — please don't send a pull request against generated |
| 98 | +files, they are overwritten on the next contract change. |
| 99 | + |
| 100 | +## Links |
| 101 | + |
| 102 | +- [Documentation](https://searchcode.ai/docs/) |
| 103 | +- [Free source search, no account needed](https://searchcode.ai/) |
| 104 | +- [Plans and pricing](https://searchcode.ai/docs/plans/) |
| 105 | +- Contact: hello@searchcode.ai |
| 106 | + |
| 107 | +## License |
| 108 | + |
| 109 | +MIT |
0 commit comments