Skip to content

Commit 3b78e7c

Browse files
CarsonRoscoekylexqian
authored andcommitted
feat: typescript - create-onchain-agent quickstart cli (coinbase#431)
* Created base create-onchain-agent package * Added base templates/next template * Improved CLI handling of wallet provider * Improve responsiveness of UI * Finished working out what a agent route looks like * Implemented API routes for CDV, Viem, Privy and Solana routes * Refactored naming of route configuration and options * Setup CLI for testing * Added branching to CLI for network -> wallet provider selection * chore: handling defaults in CLI * chore: refactored api routes to better reflect network/walletProvider combinations * fix: changes after rebase * chore: cleanup files better after refactor * feat: improve CLI display * fix: adressed feedback * feat: improved the cli logged messages * refactor: types and constants out of utils * refactor: refactored constants and types out of utils * refactor: fileSystem out of cli * feat: coinbase branding improvements * feat: improved .env.local created format * feat: improved .env.local created format * feat: parse markdown when displaying agent messages * chore: added comments to files where agents get created * chore: refactored useAgent and commented * chore: added base project README * feat: added wallet provider descriptions to cli * bump: 0.1.0 * fix: added files for npm * chore: improved readme * chore: removed @coinbase from package.json * chore: added basis for prettier and lint * chore: cli readme feedback * chore: template readme feedback * chore: add coinbase to package description * chore: fixed prettier and ran * chore: fixed lint and ran * fix: package.lock * bump: 0.1.1 * chore: typescript readme * chore: fix constants lint error * feat: add dynamic message modifier and faucet to template * chore: comment regarding faucet * chore: fixed package.lock * fix: typo in readme * chore: updated readme to better reflect the outcome of create-onchain-agent * bump: 0.1.2 * feat: added wallet persistance for cdp * chore: updated package-lock after bump
1 parent ec65458 commit 3b78e7c

36 files changed

+3124
-29
lines changed

package-lock.json

Lines changed: 472 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"private": true,
44
"workspaces": [
55
"typescript/agentkit",
6+
"typescript/create-onchain-agent",
67
"typescript/framework-extensions/langchain",
78
"typescript/examples/langchain-cdp-chatbot",
89
"typescript/examples/langchain-twitter-chatbot",

typescript/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ LangChain extension of AgentKit. Enables agentic workflows to interact with onch
1616

1717
See [AgentKit LangChain](./framework-extensions/langchain/README.md) to get started!
1818

19+
### `create-onchain-agent`
20+
21+
A quickstart CLI tool to scaffold out a fullstack chatbot application using Coinbase AgentKit. Runnable via `npm create onchain-agent@latest`.
22+
23+
See [Create Onchain Agent](./create-onchain-agent/README.md) to get started!
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": ["../../.eslintrc.base.json"]
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Source
2+
src/**
3+
./node_modules/
4+
__tests__/**
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
docs/
2+
dist/
3+
coverage/
4+
.github/
5+
src/client
6+
**/**/*.json
7+
*.md
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"semi": true,
5+
"singleQuote": false,
6+
"trailingComma": "all",
7+
"bracketSpacing": true,
8+
"arrowParens": "avoid",
9+
"printWidth": 100,
10+
"proseWrap": "never"
11+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# create-onchain-agent
2+
3+
## Overview
4+
5+
`create-onchain-agent` is a CLI tool powered by [AgentKit](https://github.com/coinbase/agentkit) that allows developers to quickly scaffold an **onchain agent** project. This tool simplifies the setup process by generating a project with predefined configurations, including blockchain network selection, wallet providers, and framework setup.
6+
7+
## Prerequisites
8+
9+
Before using `create-onchain-agent`, ensure you have the following installed:
10+
11+
- **Node.js** (v18 or later) – [Download here](https://nodejs.org/)
12+
- **npm** (v9 or later) – Comes bundled with Node.js
13+
14+
## Usage
15+
16+
To use `create-onchain-agent`, simply run:
17+
18+
```sh
19+
npm create onchain-agent@latest
20+
```
21+
22+
This command will guide you through setting up an onchain agent project by prompting for necessary configuration options.
23+
24+
## Features
25+
26+
- **Guided setup**: Interactive prompts help configure the project.
27+
- **Supports multiple blockchain networks**.
28+
- **Select your preferred wallet provider**.
29+
- **Preconfigured with Next.js, React, Tailwind CSS, and ESLint**.
30+
- **Automates environment setup**.
31+
32+
### **Setup Process**
33+
The CLI will prompt you for the following details:
34+
35+
1. **Project Name**: The name of your new onchain agent project.
36+
2. **Package Name**: The npm package name (auto-formatted if needed).
37+
3. **Network**: Choose from available blockchain networks.
38+
4. **Chain ID**: Specify if using a custom network.
39+
5. **Wallet Provider**: Select a preferred method for wallet management.
40+
41+
After answering the prompts, the CLI will:
42+
43+
- Generate the project structure.
44+
- Copy necessary template files.
45+
- Configure the selected settings.
46+
- Display next steps to get started.
47+
48+
## Getting Started
49+
50+
Once your project is created, navigate into the directory and install dependencies:
51+
52+
```sh
53+
cd my-project
54+
npm install
55+
```
56+
57+
Then, configure your environment variables:
58+
59+
```sh
60+
mv .env.local .env
61+
```
62+
63+
Run the development server:
64+
65+
```sh
66+
npm run dev
67+
```
68+
69+
## Documentation & Support
70+
71+
- **Docs:** [https://docs.cdp.coinbase.com/agentkit/docs/welcome](https://docs.cdp.coinbase.com/agentkit/docs/welcome)
72+
- **GitHub Repo:** [http://github.com/coinbase/agentkit](http://github.com/coinbase/agentkit)
73+
- **Community & Support:** [https://discord.gg/CDP](https://discord.gg/CDP)

0 commit comments

Comments
 (0)