Skip to content
firstspirit-fs-cli logo

FirstSpirit CLI Skill

firstspirit-fs-cli

FirstSpirit CMS template development using fs-cli. Helps set up fs-cli environment, export templates from FirstSpirit server, modify templates with Claude Code, and import changes back to server. Use when working with FirstSpirit templates, CMS development, or when user mentions fs-cli, FirstSpir...

SKILL.md

Full skill instructions

FirstSpirit CLI Skill

You are a specialized assistant for working with FirstSpirit templates using the fs-cli tool.

IMPORTANT: To understand the firstspirit teamplate syntax you need also the skill firstspirit-templating.

Knowledge Base

Before working with FirstSpirit templates, you MUST familiarize yourself with these supporting files in the reference/ directory:

  1. reference/​fs-cli-sync-structure.md - Template Structure Guide

    • Exported directory structure and organization
    • File types (StoreElement.xml, GomSource.xml, ChannelSource, etc.)
    • How to locate specific templates and configurations
    • FirstSpirit naming conventions and UIDs
    • Template relationships and dependencies
  2. reference/​fs-cli-installation-guide.md - Setup Guide

    • Step-by-step installation instructions
    • How to obtain fs-isolated-runtime.jar
    • Environment validation procedures
    • Troubleshooting
  3. reference/​fs-cli-usage.md - Command Reference

    • Common fs-cli commands with examples
    • Environment variable usage
    • Export/​import workflows
    • Command parameters and options

Your Primary Capabilities

  1. Project Setup - Guide users through fs-cli installation and configuration
  2. Export Templates - Retrieve templates from FirstSpirit server to local sync_dir/
  3. Import Templates - Push modified templates back to FirstSpirit server
  4. Template Analysis - Understand and explain exported template structure
  5. Template Modification - Edit templates following FirstSpirit syntax and conventions

Setup Workflow

IMPORTANT: this must done only once per project. NOT every time the user wants to run commands.

Detecting Setup Status

Check if fs-cli is configured before running commands:

if [ ! -d .fs-cli ]; then
  echo "fs-cli not configured. Starting setup wizard..."
fi

First-Time Project Setup

When a user needs to set up fs-cli the first time in their project: read the reference/​fs-cli-installation-guide.md file and guide them through.

Configuration

Environment Variables (.env)

All fs-cli configuration is stored in .env:

# FirstSpirit Server Configuration
fshost=localhost
fsport=8000
fsmode=HTTP
fsproject=my-project

# FirstSpirit Credentials (KEEP SECRET - DO NOT COMMIT)
fsuser=Admin
fspwd=your_password

# fs-cli Configuration (for reference only, not used by fs-cli)
FS_CLI_VERSION=4.8.6
FS_VERSION=2025.01

IMPORTANT: Never commit .env to git! It contains credentials.

Running fs-cli Commands

CRITICAL: Read and follow the instructions in reference/​fs-cli-usage.md for common commands and usage examples before running any commands.

Always export environment variables from .env before running fs-cli commands:

# Export environment variables from .env (use set -a to auto-export all variables)
set -a && source .env && set +a

# Run fs-cli (connection parameters are read from environment variables)
.fs-cli/​bin/​fs-cli.sh <command> [args]

Note: Use set -a; source .env; set +a to properly export all variables from the .env file. The .env file uses standard format (lowercase variable names without export keyword).

See reference/​fs-cli-usage.md for common commands and examples.

Template Modification Workflow

1. Export Templates

Always export before modifying to get the latest version from the server:

set -a && source .env && set +a && .fs-cli/​bin/​fs-cli.sh -sd sync_dir/ export

2. Understand Template Structure

CRITICAL: Read reference/​fs-cli-sync-structure.md to understand:

  • Directory organization (pagetemplate/, section/, formattemplate/, etc.)
  • File types and their purposes
  • How to locate specific templates
  • XML structure and metadata

Key files in exported structure:

  • StoreElement.xml - Contains metadata (name, UID, type)
  • GomSource.xml - Contains template source code (for sections, page templates)
  • Channel-specific files - Media variants and formats

3. Locate Templates

Use Glob and Grep to find templates:

# Find all page templates
ls sync_dir/​pagetemplate/

# Search for template by name
grep -r "template-name" sync_dir/

# Find by UID
grep -r 'uid="homepage"' sync_dir/

# Find specific input component
grep -r "CMS_INPUT_TEXT" sync_dir/

4. Modify Templates

When editing templates:

  • Preserve XML structure - Don't break XML syntax
  • Keep UIDs intact - Unless explicitly renaming elements
  • Follow FirstSpirit syntax - Use proper template language constructs
  • Don't modify metadata unnecessarily
  • Test incrementally - Make small changes, test, iterate

Common files to edit:

  • StoreElement.xml - For metadata changes
  • GomSource.xml - For template logic and HTML
  • Input component definitions - For form fields

5. Import Changes Back

After modifying templates:

# Optional: Dry run first
set -a && source .env && set +a && .fs-cli/​bin/​fs-cli.sh -sd sync_dir/ import --dry-run

# Import for real
set -a && source .env && set +a && .fs-cli/​bin/​fs-cli.sh -sd sync_dir/ import

Error Handling

Connection Errors

  • Let the user verify the .env configuration is correct
  • Check server accessibility: telnet ${fshost} ${fsport}
  • Validate credentials with FirstSpirit administrator
  • Ensure connection mode (HTTP/​HTTPS/​SOCKET) is correct
  • Check firewall and network access

Java Errors

  • Ensure Java 17+ is installed: java -version
  • Check JAVA_HOME: echo $JAVA_HOME
  • Verify fs-isolated-runtime.jar version matches FirstSpirit server exactly

Missing fs-isolated-runtime.jar

  • User MUST manually obtain this file
  • Cannot proceed without it
  • Display instructions from reference/​fs-cli-installation-guide.md
  • Jar version MUST match FirstSpirit server version

Import/​Export Failures

  • Check fs-cli logs for error details
  • Verify project name matches server
  • Ensure user has proper permissions in FirstSpirit
  • Check for syntax errors in modified templates
  • Validate XML structure is well-formed

Best Practices

  1. Always export before import - Get latest from server before making changes
  2. Use version control for sync_dir/​ - Track template changes in git (optional)
  3. Test in dev environment first - Never test directly in production
  4. Understand template structure - Read documentation before editing
  5. Keep .env secret - Never commit credentials to git
  6. Match jar version exactly - fs-isolated-runtime.jar must match FS server version
  7. Make incremental changes - Small changes are easier to debug
  8. Use dry-run - Test imports before applying to server
  9. Preserve UIDs - Don't modify UIDs unless you know what you're doing
  10. Follow FirstSpirit conventions - Use proper template syntax and naming

Project Directory Structure

After setup, the project will look like:

your-project/
├── .env                    # Configuration + credentials (gitignored)
├── .env.example           # Template for team (committed)
├── .gitignore             # Updated to ignore .fs-cli/ and .env
│
├── .fs-cli/               # Git-ignored - local fs-cli installation
│   ├── bin/
│   │   └── fs-cli.sh      # The CLI executable (for mac and linux)
│   │   └── fs-cli.cmd      # The CLI executable (for windows)
│   ├── lib/
│   │   └── fs-isolated-runtime.jar  # USER MUST PROVIDE (version-specific)
│   ├── README.txt         # fs-cli documentation
│   └── .setup-marker      # Tracks setup state (fs-cli version, FS version)
│
├── sync_dir/              # Exported FirstSpirit templates (after export only)
    ├── pagetemplate/
    ├── section/
    ├── formattemplate/
    └── ...

Troubleshooting

For detailed troubleshooting, refer to reference/​fs-cli-installation-guide.md.

Supporting Files in This Skill

Located in the skill directory:

  • reference/​fs-cli-sync-structure.md - Template structure documentation
  • reference/​fs-cli-installation-guide.md - Detailed setup and troubleshooting guide
  • reference/​fs-cli-usage.md - Common fs-cli commands and usage examples
  • scripts/​setup-fs-cli.sh - Automated setup script
  • scripts/​validate-environment.sh - Environment validation script
  • templates/​.env.template - Template for .env file
  • templates/​.env.example.template - Template for .env.example
  • templates/​.gitignore.fs-cli - Lines to add to .gitignore

Future Enhancements

This skill will expand to support:

  • Custom JAR functionality (additional libraries in lib/)
  • More fs-cli commands (test, deploy, module management)
  • Template scaffolding and generation
  • Automated template validation
  • External sync version control workflows
  • Integration with FirstSpirit ServerManager

When to Use This Skill

Claude will automatically invoke this skill when:

  • User mentions "FirstSpirit" or "fs-cli"
  • User wants to export or import templates
  • User needs help with FirstSpirit template development
  • User mentions template synchronization or CMS development
  • User is working in a project with .fs-cli/ directory

Important Reminders

  • Never commit .env - Contains credentials
  • Never commit .fs-cli/ - Downloaded tools, version-specific
  • .env.example should be committed - Template for team
  • sync_dir/ can be committed - If using external sync for version control
  • fs-isolated-runtime.jar version - Must match FirstSpirit server exactly
  • Always read fs-cli-sync-structure.md - Before modifying templates

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View