Skip to content

Commit 755695a

Browse files
committed
blank
1 parent a1a2463 commit 755695a

19 files changed

+456
-27
lines changed

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hatchet-dev/pickaxe-cli",
3-
"version": "0.1.23",
3+
"version": "0.1.24",
44
"main": "dist/index.js",
55
"bin": {
66
"pickaxe": "./dist/index.js"

cli/src/commands/create.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ async function getProjectConfig(initialName?: string): Promise<ProjectConfig> {
9292
name: "template",
9393
message: "Project template:",
9494
choices: [
95+
{
96+
title: "Blank",
97+
value: "blank",
98+
description: "A blank starter project",
99+
},
95100
{
96101
title: "Deep Research Agent",
97102
value: "deep-research",
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
pnpm-debug.log*
7+
8+
# Build outputs
9+
dist/
10+
build/
11+
*.tsbuildinfo
12+
13+
# Environment variables
14+
.env
15+
.env.local
16+
.env.*.local
17+
18+
# IDE and editor files
19+
.vscode/
20+
.idea/
21+
*.swp
22+
*.swo
23+
*~
24+
25+
# OS generated files
26+
.DS_Store
27+
.DS_Store?
28+
._*
29+
.Spotlight-V100
30+
.Trashes
31+
ehthumbs.db
32+
Thumbs.db
33+
34+
# Git
35+
.git/
36+
.gitignore
37+
38+
# Docker
39+
Dockerfile*
40+
.dockerignore
41+
42+
# Documentation
43+
README.md
44+
*.md
45+
46+
# Coverage and test reports
47+
coverage/
48+
*.lcov
49+
50+
# Temporary folders
51+
tmp/
52+
temp/
53+
54+
# Logs
55+
logs/
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
OPENAI_API_KEY=your_openai_api_key_here
2+
HATCHET_CLIENT_TOKEN=your_hatchet_api_key_here

cli/templates/blank/.gitignore.hbs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
pnpm-debug.log*
7+
8+
# Build outputs
9+
dist/
10+
build/
11+
*.tsbuildinfo
12+
13+
# Environment variables
14+
.env
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
# IDE files
21+
.vscode/
22+
.idea/
23+
*.swp
24+
*.swo
25+
*~
26+
27+
# OS generated files
28+
.DS_Store
29+
.DS_Store?
30+
._*
31+
.Spotlight-V100
32+
.Trashes
33+
ehthumbs.db
34+
Thumbs.db
35+
36+
# Logs
37+
logs/
38+
*.log
39+
40+
# Runtime data
41+
pids/
42+
*.pid
43+
*.seed
44+
*.pid.lock
45+
46+
# Coverage directory used by tools like istanbul
47+
coverage/
48+
*.lcov
49+
50+
# nyc test coverage
51+
.nyc_output/
52+
53+
# Jest
54+
coverage/
55+
56+
# Results directory for trigger command
57+
results/
58+
59+
# Temporary files
60+
*.tmp
61+
*.temp

cli/templates/blank/Dockerfile.hbs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Use Node.js LTS version
2+
FROM node:20-alpine
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Copy package files
8+
COPY package*.json ./
9+
COPY pnpm-lock.yaml* ./
10+
11+
# Install pnpm
12+
RUN npm install -g pnpm
13+
14+
# Install dependencies
15+
RUN pnpm install
16+
17+
# Copy source code
18+
COPY . .
19+
20+
# Build the application
21+
RUN pnpm build
22+
23+
# Expose port (adjust if your app uses a different port)
24+
EXPOSE 3000
25+
26+
# Create non-root user for security
27+
RUN addgroup -g 1001 -S nodejs
28+
RUN adduser -S {{name}} -u 1001
29+
30+
# Change ownership of the app directory
31+
RUN chown -R {{name}}:nodejs /app
32+
USER {{name}}
33+
34+
# Start the application
35+
CMD ["pnpm", "start"]

cli/templates/blank/README.md.hbs

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# {{name}}
2+
3+
A geographic information agent built with Pickaxe that provides weather, time, and holiday information for any location.
4+
5+
## Getting Started
6+
7+
1. Install dependencies:
8+
```bash
9+
pnpm install
10+
```
11+
12+
2. Set up your environment variables:
13+
```bash
14+
cp .env.example .env
15+
```
16+
17+
Edit `.env` and add your API keys (the Hatchet token can be generated at [Hatchet Cloud](https://cloud.onhatchet.run) or by [self-hosting Hatchet]((https://docs.hatchet.run/self-hosting))).
18+
19+
3. Run the agent:
20+
```bash
21+
pnpm run dev
22+
```
23+
24+
4. Trigger the interactive CLI:
25+
```bash
26+
pnpm run trigger
27+
```
28+
29+
## Usage
30+
31+
### Interactive CLI
32+
33+
The easiest way to interact with the {{name}} agent is through the interactive CLI:
34+
35+
```bash
36+
pnpm run trigger
37+
```
38+
39+
This will launch an interactive menu where you can:
40+
- Choose from preset queries (weather, time, holidays)
41+
- Enter custom queries
42+
- View results and save them to markdown files
43+
44+
### Development Mode
45+
46+
Run the agent in development mode:
47+
```bash
48+
pnpm run dev
49+
```
50+
51+
### Build and Run
52+
53+
Build and run the compiled version:
54+
```bash
55+
pnpm run build
56+
pnpm start
57+
```
58+
59+
## Project Structure
60+
61+
- `src/agents/{{kebabCase name}}/` - Main agent implementation
62+
- `src/agents/{{kebabCase name}}/tools/` - Tools used by the agent
63+
- `weather.ts` - Weather information using Open-Meteo API
64+
- `time.ts` - Time information using WorldTimeAPI
65+
- `holiday.ts` - Holiday information using Nager.Date API
66+
- `src/trigger.ts` - Interactive CLI for running the agent
67+
- `src/main.ts` - Entry point for standard execution
68+
- `src/pickaxe-client.ts` - Pickaxe client configuration
69+
- `results/` - Generated result files from trigger sessions
70+
71+
## Available Tools
72+
73+
### Weather Tool
74+
Get current weather and forecasts for any city worldwide.
75+
- Uses Open-Meteo API (no API key required)
76+
- Provides temperature, conditions, humidity, wind speed
77+
- Example: "What's the weather in Tokyo?"
78+
79+
### Time Tool
80+
Get current time and timezone information for any location.
81+
- Uses WorldTimeAPI (no API key required)
82+
- Example: "What time is it in London?"
83+
84+
### Holiday Tool
85+
Get information about public holidays in any country.
86+
- Uses Nager.Date API (no API key required)
87+
- Supports current holidays and upcoming holidays
88+
- Example: "What holidays are coming up in Canada?"
89+
90+
## Environment Variables
91+
92+
| Variable | Required | Description |
93+
|----------|----------|-------------|
94+
| `OPENAI_API_KEY` | Yes | Your OpenAI API key for the language model |
95+
| `HATCHET_CLIENT_TOKEN` | Yes | Your Hatchet API token for orchestration |
96+
97+
## Example Queries
98+
99+
- "What's the current weather in Paris?"
100+
- "What time is it in Sydney right now?"
101+
- "Are there any holidays today in Germany?"
102+
- "Tell me about the weather forecast for New York this week"
103+
- "What's the time difference between Los Angeles and Tokyo?"
104+
105+
## Scripts
106+
107+
- `pnpm run trigger` - Run the interactive agent CLI
108+
- `pnpm run dev` - Run in development mode
109+
- `pnpm run build` - Build the project
110+
- `pnpm start` - Run the built project
111+
- `pnpm test` - Run tests
112+
- `pnpm run lint` - Run linting
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"watch": ["src"],
3+
"ext": "ts,json",
4+
"ignore": [
5+
"src/**/*.test.ts",
6+
"src/**/*.spec.ts",
7+
"dist/**/*",
8+
"node_modules/**/*"
9+
],
10+
"exec": "ts-node -r tsconfig-paths/register src/main.ts",
11+
"env": {
12+
"NODE_ENV": "development"
13+
},
14+
"delay": "1000",
15+
"verbose": true,
16+
"restartable": "rs"
17+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "{{kebabCase name}}",
3+
"version": "0.1.0",
4+
"description": "{{name}} project using @hatchet-dev/pickaxe",
5+
"main": "dist/index.js",
6+
"scripts": {
7+
"build": "tsc",
8+
"start": "node dist/index.js",
9+
"dev": "nodemon",
10+
"dev:trigger": "nodemon --exec \"ts-node -r tsconfig-paths/register src/trigger.ts\"",
11+
"trigger": "ts-node -r tsconfig-paths/register src/trigger.ts",
12+
"test": "jest",
13+
"test:watch": "jest --watch",
14+
"lint": "eslint . --ext .ts",
15+
"lint:fix": "eslint . --ext .ts --fix"
16+
},
17+
"dependencies": {
18+
"@ai-sdk/openai": "^1.1.10",
19+
"@hatchet-dev/pickaxe": "^0.1.2",
20+
"ai": "^4.3.16",
21+
"dotenv": "^16.5.0",
22+
"zod": "^3.25.64"
23+
},
24+
"devDependencies": {
25+
"@types/jest": "^29.5.14",
26+
"@types/node": "^20.19.0",
27+
"@typescript-eslint/eslint-plugin": "^7.18.0",
28+
"@typescript-eslint/parser": "^7.18.0",
29+
"eslint": "^8.57.1",
30+
"jest": "^29.7.0",
31+
"nodemon": "^3.0.2",
32+
"ts-jest": "^29.4.0",
33+
"ts-node": "^10.9.2",
34+
"tsconfig-paths": "^4.2.0",
35+
"typescript": "^5.8.3"
36+
}
37+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './{{kebabCase name}}.agent';

0 commit comments

Comments
 (0)