Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AI Builder Club Skills dev local template sh

From Leeroopedia
Knowledge Sources
Domains Developer_Tooling, Dev_Environments
Last Updated 2026-10-24 00:00 GMT

Overview

Concrete tool for bringing a project's local dev stack up in one command using tmux session management, provided by the dev-local-setup skill.

Description

The dev-local.template.sh is a template script that generates a repo-specific scripts/dev-local.sh launcher. It manages a tmux session with one window per long-lived dev server, starts infra containers (Docker), and provides subcommands: up (start infra + servers, idempotent), down (stop servers, optionally infra), status (window list + port check), logs (tail a window), restart, and attach. The template uses <PLACEHOLDER> markers for project-specific values (session name, ports, server commands, infra containers) that are filled from repo discovery.

Usage

Use this template when setting up the "executable" pillar of the codebase harness. Fill in SERVERS (name|start_cmd pairs), INFRA_PORTS (name:port), and <PKG_MANAGER> from repo discovery. Generated dev-local.sh is the STACK_UP command referenced by verifier_setup_skill.

Code Reference

Source Location

Signature

# Subcommands:
dev-local.sh up            # Start infra + all dev servers (idempotent)
dev-local.sh down          # Stop dev servers (leaves infra running)
dev-local.sh down --all    # Also stop infra
dev-local.sh status        # Window list + port check
dev-local.sh logs <name>   # Tail a window's output
dev-local.sh restart <name>
dev-local.sh attach        # Attach to the tmux session

# Key internal functions:
start_window()  # idempotent: skip if window already exists
cmd_up()        # preflight + ensure_infra + start all SERVERS windows
cmd_status()    # list tmux windows + port_check
cmd_down()      # kill tmux session + optional infra teardown
port_up()       # check if a port is listening (lsof)
preflight()     # verify tmux + package manager + deps installed

Import

# Generated script lives at scripts/dev-local.sh in the target repo.
# Run from repo root:
scripts/dev-local.sh up

I/O Contract

Inputs

Name Type Required Description
SESSION str Yes Tmux session name (template: <PROJECT>-dev)
SERVERS array Yes start_cmd" pairs, one per dev server
INFRA_PORTS array No "name:port" pairs for infra container port checks
ROOT str Auto Repo root (auto-detected from script location)

Outputs

Name Type Description
tmux session process Named session with one window per server, each running its start command
port status stdout Colored port-up/starting indicators for infra ports

Usage Examples

Filled Template Example

# Config section (filled from repo discovery):
SESSION="myapp-dev"
SERVERS=(
  "web|pnpm --filter web run dev"
  "api|pnpm --filter api run dev"
)
INFRA_PORTS=(
  "postgres:5432"
  "redis:6379"
)

# Start the stack:
scripts/dev-local.sh up
# ✓ Stack starting in tmux session 'myapp-dev'.
#   Port status:
#     ● postgres      :5432
#     ● redis         :6379

# Check status:
scripts/dev-local.sh status
# ▸ tmux 'myapp-dev' windows:
#     0: web
#     1: api

# Stop:
scripts/dev-local.sh down
# ✓ dev servers stopped

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment