# @0xgraph/cli

> The 0xgraph CLI to deploy subgraphs, index & transform blockchain data, and access your data in real-time.

Latest version **0.2.1** (published 2024-07-02) · none license · 0 weekly downloads

## Install

```sh
npm install @0xgraph/cli
pnpm add @0xgraph/cli
yarn add @0xgraph/cli
bun add @0xgraph/cli
```

Provides the command `0xgraph`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2024-07-02 |
| First published | 2023-06-08 |
| Weekly downloads | 0 |
| License | none |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 27 |
| Unpacked size | 701.6 KB |
| Known vulnerabilities | 0 (+11 in 5 direct dependencies) |
| Install scripts | no |

## Links

- npm: https://www.npmjs.com/package/@0xgraph/cli
- npm.io page: https://npm.io/package/@0xgraph/cli

## Dependencies (27)

- [glob](https://npm.io/package/glob.md) 9.3.5
- [yaml](https://npm.io/package/yaml.md) 1.10.2
- [chalk](https://npm.io/package/chalk.md) 3.0.0
- [debug](https://npm.io/package/debug.md) 4.3.4
- [which](https://npm.io/package/which.md) 2.0.2
- [jayson](https://npm.io/package/jayson.md) 4.0.0
- [semver](https://npm.io/package/semver.md) 7.4.0
- [gluegun](https://npm.io/package/gluegun.md) 5.1.6
- [graphql](https://npm.io/package/graphql.md) 15.5.0
- [js-yaml](https://npm.io/package/js-yaml.md) 3.14.1
- [chokidar](https://npm.io/package/chokidar.md) 3.5.3
- [fs-extra](https://npm.io/package/fs-extra.md) 9.1.0
- [prettier](https://npm.io/package/prettier.md) 3.0.3
- [dockerode](https://npm.io/package/dockerode.md) 2.5.8
- [immutable](https://npm.io/package/immutable.md) 4.2.1
- [@oclif/core](https://npm.io/package/@oclif/core.md) 2.8.6
- [tmp-promise](https://npm.io/package/tmp-promise.md) 3.0.3
- [sync-request](https://npm.io/package/sync-request.md) 6.1.0
- [web3-eth-abi](https://npm.io/package/web3-eth-abi.md) 1.7.0
- [assemblyscript](https://npm.io/package/assemblyscript.md) 0.19.23
- [docker-compose](https://npm.io/package/docker-compose.md) 0.23.19
- [ipfs-http-client](https://npm.io/package/ipfs-http-client.md) 55.0.0
- [@whatwg-node/fetch](https://npm.io/package/@whatwg-node/fetch.md) ^0.8.4
- [binary-install-raw](https://npm.io/package/binary-install-raw.md) 0.0.13
- [@oclif/plugin-not-found](https://npm.io/package/@oclif/plugin-not-found.md) ^2.4.0
- [@oclif/plugin-autocomplete](https://npm.io/package/@oclif/plugin-autocomplete.md) ^2.3.6
- [@float-capital/float-subgraph-uncrashable](https://npm.io/package/@float-capital/float-subgraph-uncrashable.md) ^0.0.0-alpha.4

## Recent versions

- 0.2.1 (latest) — 2024-07-02
- 0.2.0 — 2024-05-13
- 0.1.1 — 2023-10-31
- 0.0.10 — 2023-10-10
- 0.0.9 — 2023-08-10
- 0.0.8 — 2023-08-09
- 0.0.7 — 2023-08-02
- 0.0.6 — 2023-07-21
- 0.0.5 — 2023-07-18
- 0.0.4 — 2023-07-04
- 0.0.3 — 2023-06-26
- 0.0.2 — 2023-06-14
- 0.0.1 — 2023-06-08

## README

# 0xgraph CLI

## The [0xgraph](http://0xgraph.xyz) CLI to deploy subgraphs, index & transform blockchain data, and access your data in real-time.

## Usage

- `0xgraph init` — Creates a new subgraph project from an example or an existing contract.
- `0xgraph create` — Registers a subgraph name.
- `0xgraph remove` — Unregisters a subgraph name.
- `0xgraph codegen` — Generates AssemblyScript types for smart contract ABIs and the subgraph
  schema.
- `0xgraph build` — Compiles a subgraph to WebAssembly.
- `0xgraph deploy` — Deploys a subgraph to [0xgraph](http://0xgraph.xyz).

**deploy** command requires several flags to be provided to complete successfully. See below:

| Flag/Example                                          | Required | Description                                                                                                                                                         |
| ----------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--node http://65.109.19.223:8020`                    | Yes      | URL of the valid [Graph Node](https://github.com/graphprotocol/graph-node) instance.                                                                                |
| `--ipfs http://65.109.19.223:5001`                    | Yes      | URL of the [IPFS](https://ipfs.tech/) API.                                                                                                                          |
| `--version-pub-url http://95.217.114.57:8050/version` | No       | URL of the [api-extensions-service](https://github.com/ormi-labs/graphnode-api-extensions) endpoint for publishing deploy version. Skip publishing if not provided. |

- `0xgraph auth` — Stores a [Graph 0xgraph](http://0xgraph.xyz) access token in the system's
  keychain.
- `0xgraph local` — Runs tests against a test environment (using Ganache by default).
- `0xgraph test` — Downloads and runs the [Matchstick](https://github.com/LimeChain/matchstick) rust
  binary in order to test a subgraph.
- `0xgraph add` - Adds a new datasource to the yaml file and writes the necessary changes to other
  files - schema.graphql, abi and mapping.

## Installation

We recommend install the CLI using package manager `npm` or `yarn` or `pnpm` when developing
subgraphs locally:

```sh
# NPM
npm install -g @0xgraph/cli

# Yarn
yarn global add @0xgraph/cli

# pnpm
pnpm add -g @0xgraph/cli
```

### Linux

On linux, `libsecret` is used for managing access tokens, so it may be necessary to install it
before running the cli.

- Debian/Ubuntu: `sudo apt-get install libsecret-1-dev`
- Red Hat: `sudo yum install libsecret-devel`
- Arch Linux: `sudo pacman -S libsecret`
- NixOS: `nix-shell -p libsecret` (or edit configuration.nix)

---
_Source: https://npm.io/package/@0xgraph/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
