Skip to main content

Idiomark Quick Start

Get up and running with Idiomark in 5 minutes.

Prerequisites​

Before You Start

Make sure you have the following installed:

  • Node.js 18+ (LTS recommended)
  • pnpm 9+ (or npm equivalent)

You can verify with: node --version && pnpm --version

Installation​

# Install the CLI globally
npm install -g @idiomark/cli

# Or use with pnpm
pnpm add -g @idiomark/cli

Your First Idiomark File​

# Clone the repo (or download demo.idiomark)
git clone https://github.com/idiomark/idiomarkengine.git
cd idiomark

# Validate the demo file
idiomark validate examples/demo.idiomark

# View personality info
idiomark info examples/demo.idiomark

# Start the inference server
idiomark serve examples/demo.idiomark

Test the Inference Server​

# Start the server
idiomark serve examples/demo.idiomark

# In another terminal, test it
curl -X POST http://localhost:3000/generate \
-H "Content-Type: application/json" \
-d '{"message": "What is Idiomark?"}'

# Check health
curl http://localhost:3000/health

# View loaded personality
curl http://localhost:3000/personality

SDK Usage​

# Create a new project
mkdir my-idiomark-app && cd my-idiomark-app
pnpm init

# Install the SDK
pnpm add @idiomark/sdk

# Create index.js
cat > index.js << 'EOF'
import { IdiomarkClient } from '@idiomark/sdk'

const client = new IdiomarkClient()

const result = await client.generate({
message: "Hello, world!",
personality: require('./demo.idiomark')
})

console.log(result.response)
EOF

# Run it
node index.js

Next Steps​

Troubleshooting​

Quick Fixes for Common Errors

If something goes wrong, here are the most likely solutions:

  • Command not found: Install globally with npm install -g @idiomark/cli or use npx @idiomark/cli
  • Module errors: Run pnpm install from the monorepo root to link workspaces
  • Validation failures: Use idiomark validate --strict for detailed error messages
  • Port conflicts: If port 3000 is in use, specify another: idiomark serve demo.idiomark -p 3001

"idiomark: command not found"​

  • Make sure you installed globally: npm install -g @idiomark/cli
  • Check your PATH is set up correctly
  • Try npx idiomark instead

"Cannot find module '@idiomark/core'"​

  • Make sure you're in the monorepo root
  • Run pnpm install to link workspaces

Validation errors​

  • Run idiomark validate --strict for detailed error messages
  • Check your .idiomark file matches the spec