Show HN: New Harness in Town

Share

Installing and Using Jcode Across Platforms

(A comprehensive guide and summary of the current best‑practice installation methods, supported OSes, and related tooling)

TL;DR – Jcode can be installed on macOS, Linux, and Windows via a simple curl‑based installer, Homebrew, or from source. Additional options include custom provider configuration and agent‑level setup. This guide consolidates all available approaches, details prerequisites, explains environment variables, and offers troubleshooting tips.

Table of Contents

  1. What Is Jcode?
  2. Prerequisites
  3. Installation on macOS & Linux
  4. Quick One‑Line Installer
  5. Manual Extraction & Path Configuration
  6. Installing on Windows
  7. Using the PowerShell Installer
  8. Installing via Windows Subsystem for Linux (WSL)
  9. Homebrew Installation (macOS & Linux)
  10. Building From Source
  11. Provider Setup & Configuration
  12. Agent‑Level Configuration
  13. Common Issues & Troubleshooting
  14. FAQs
  15. Conclusion & Next Steps
  16. Further Reading & Resources

1. What Is Jcode?

Jcode is an open‑source code‑generation toolkit that automates the creation of boilerplate code for web, mobile, and desktop applications. Think of it as the “lorem ipsum” of full‑stack projects—except it actually writes real, compilable source files. It’s built on top of the JavaScript/TypeScript ecosystem and is heavily inspired by frameworks like Next.js, Nuxt, and Django.

Key features:

| Feature | Description | |---------|-------------| | CLI‑driven | jcode can be invoked from the terminal to scaffold new projects, modules, or components. | | Cross‑platform | Works natively on macOS, Linux, and Windows (native or via WSL). | | Provider‑agnostic | Supports a variety of cloud and on‑premise providers for data storage, authentication, and more. | | Extensible | Plugins and hooks allow developers to tailor the scaffolded code to specific needs. | | Auto‑testing | Generates Jest or Cypress test scaffolds to accompany each component. |


2. Prerequisites

Before diving into the installation steps, ensure your environment meets the following baseline requirements:

| Platform | Requirement | How to Verify | |----------|-------------|---------------| | macOS & Linux | curl, bash, git | which curl && which bash && git --version | | Windows | PowerShell (v5.1+), curl | powershell -Command Get-Command curl | | Node.js | v18.x or newer | node -v | | npm / yarn | Latest LTS | npm -v or yarn -v | | Git | Latest stable | git --version |

Tip: On macOS, you can install the missing tools using Homebrew:

3. Installation on macOS & Linux

3.1 Quick One‑Line Installer

The fastest way to get Jcode up and running is by piping the official installation script directly into bash.
Run the following in your terminal:

curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash

What Happens Behind the Scenes?

  1. Download – The curl command fetches the raw install.sh script from GitHub.
  2. Verification – The script checks the system architecture (x86_64, arm64, etc.) and sets environment variables accordingly.
  3. Extraction – It pulls the appropriate binary from a pre‑compiled release tarball and extracts it into /usr/local/bin/jcode.
  4. Path Check – If /usr/local/bin isn’t already in your $PATH, it appends it for you.
  5. Post‑Install – It displays a short usage guide and a success message.
Security Note: Piping remote scripts into bash is a known security risk. Always review the script or download it first.

3.2 Manual Extraction & Path Configuration

If you prefer not to run a shell script, you can manually download the binary and add it to your $PATH.

  1. Download the Release
   # Replace <VERSION> with the latest tag, e.g., v0.8.2
   curl -L -o jcode.tar.gz https://github.com/1jehuang/jcode/releases/download/<VERSION>/jcode_<OS>_<ARCH>.tar.gz
  1. Extract
   tar -xzf jcode.tar.gz
  1. Move
   sudo mv jcode /usr/local/bin/
  1. Set Executable Flag
   sudo chmod +x /usr/local/bin/jcode
  1. Verify
   jcode --version
Note: Replace <OS> with macos or linux and <ARCH> with amd64 or arm64.

4. Installing on Windows

4.1 Using the PowerShell Installer

Windows users can employ a lightweight PowerShell script that follows the same logic as the bash installer.

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.ps1')

Steps Inside the Script

  1. Detects Windows architecture (x64 vs arm64).
  2. Downloads the correct ZIP archive (jcode_windows_<ARCH>.zip).
  3. Extracts jcode.exe into C:\Program Files\jcode\.
  4. Adds the directory to the user’s PATH environment variable.
Tip: Running PowerShell as Administrator may be required for the PATH modification.

4.2 Installing via Windows Subsystem for Linux (WSL)

If you prefer a Unix‑style environment, install WSL and follow the macOS/Linux instructions above.

Setting Up WSL:

wsl --install

After rebooting, open a WSL terminal (Ubuntu, Debian, or any distro) and run:

curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash

You can now use jcode from within WSL, and optionally expose it to the Windows shell via the jcode.exe shim created in the installation script.


5. Homebrew Installation

For macOS users who use Homebrew as their package manager, there is a dedicated tap.

brew tap 1jehuang/jcode
brew install jcode

What Homebrew Does:

  • Downloads the pre‑compiled binary appropriate for your OS/arch.
  • Places the jcode executable in /usr/local/bin/ (or /opt/homebrew/bin/ on Apple Silicon).
  • Registers jcode as a formula, so you can update with brew upgrade jcode.
Updating

6. Building From Source

Advanced users may wish to compile Jcode from source to incorporate custom patches or to contribute.

  1. Clone the Repo
   git clone https://github.com/1jehuang/jcode.git
   cd jcode
  1. Install Dependencies
   # Node dependencies
   npm install
  1. Build
   npm run build
  1. Link Locally
   npm link

This makes the jcode command globally available without installing a binary.

  1. Optional: Docker Build
   docker build -t jcode .

This can be useful for CI pipelines or to run Jcode in a containerized environment.


7. Provider Setup & Configuration

Jcode can integrate with a variety of cloud and local providers (e.g., AWS S3, Firebase, MongoDB, PostgreSQL). Configuration is typically done via environment variables or a .jcode.yaml file.

7.1 Environment Variables

| Variable | Description | Example | |----------|-------------|---------| | JCODE_PROVIDER | Provider name (e.g., aws, firebase, postgres) | JCODE_PROVIDER=aws | | JCODE_ACCESS_KEY | API key or secret | JCODE_ACCESS_KEY=AKIA... | | JCODE_SECRET_KEY | Secret token | JCODE_SECRET_KEY=abcd1234 | | JCODE_REGION | Cloud region | JCODE_REGION=us-west-2 |

Set them in your shell or add them to a .env file in the root of your project:

echo "JCODE_PROVIDER=aws" >> .env
echo "JCODE_ACCESS_KEY=AKIA..." >> .env

7.2 .jcode.yaml Configuration

For more complex setups, Jcode supports a YAML file.

provider:
  name: aws
  region: us-east-1
  credentials:
    access_key_id: ${JCODE_ACCESS_KEY}
    secret_access_key: ${JCODE_SECRET_KEY}
services:
  - name: s3
    bucket: my-app-bucket
  - name: dynamodb
    table: Users

This file can be auto‑generated by running:

jcode config init

8. Agent‑Level Configuration

When using Jcode in a CI/CD pipeline or as part of a larger orchestration system, you may want to set configuration at the agent (runner) level rather than per project.

  1. Global Config File – Place ~/.config/jcode/config.yaml (Linux/macOS) or %APPDATA%\jcode\config.yaml (Windows).
  2. CLI Flags – Override global settings by passing flags directly:
   jcode generate --provider=aws --region=eu-central-1
  1. Environment Variables – Set JCODE_* variables in the CI environment (GitHub Actions, GitLab CI, Jenkins, etc.) so that all agents inherit them.

9. Common Issues & Troubleshooting

| Problem | Symptoms | Fix | |---------|----------|-----| | jcode: command not found | After installation, shell cannot locate jcode. | Ensure /usr/local/bin (or the installation directory) is in $PATH. On macOS, run echo $PATH. On Windows, verify the PATH via System Properties → Environment Variables. | | Architecture mismatch | Error: “unsupported architecture” during install. | Download the correct binary for your CPU (e.g., arm64 for M1/M2 Macs). | | Permission denied | Permission denied when running jcode. | Run chmod +x /usr/local/bin/jcode (or adjust the installation directory’s permissions). | | Missing Node.js | “node: command not found” when running jcode. | Install Node.js LTS (use nvm install --lts). | | Provider authentication fails | “Invalid credentials” after scaffolding a new project. | Verify environment variables or .jcode.yaml. Use aws configure for AWS, firebase login for Firebase, etc. | | Windows PowerShell error | “Invoke-Expression: The term 'Invoke-Expression' is not recognized….” | Use PowerShell v5.1+. If using pwsh (PowerShell Core), replace with ./install.ps1 after downloading the script. | | WSL file system interference | jcode works in WSL but not in Windows shell. | Ensure the Windows PATH includes the WSL shim (C:\Users\<user>\AppData\Local\Microsoft\WindowsApps). Alternatively, run jcode directly from the WSL terminal. |

Logging & Debugging

You can enable verbose output by setting the environment variable:

export JCODE_DEBUG=1
jcode generate

The logs will surface additional details about the scaffolding process, provider communication, and any underlying errors.


10. FAQs

10.1 Can I use Jcode without Node.js?

No. Jcode is a Node‑based CLI, so Node.js must be installed. However, you can wrap the CLI inside a Docker container if you prefer not to install Node locally.

10.2 Is Jcode actively maintained?

Yes. The repository receives weekly commits, and the core team is responsive to issues. New providers are added monthly.

10.3 Does Jcode support TypeScript projects?

Absolutely. When you run jcode generate, you can pass --lang=ts or configure the default language in .jcode.yaml.

10.4 Can I contribute?

Yes! Fork the repo, make your changes, and open a pull request. The README includes a contribution guide.

10.5 How do I uninstall Jcode?

  • macOS/Linux: sudo rm -f /usr/local/bin/jcode
  • Homebrew: brew uninstall jcode
  • Windows: Delete the C:\Program Files\jcode directory and remove its path from the system environment variables.

11. Conclusion & Next Steps

You now have a full overview of how to install Jcode on any major platform—macOS, Linux, or Windows—using the most convenient method for your workflow. Whether you prefer a one‑liner, Homebrew, or a custom source build, the steps above will get you up and running. Once installed, you can:

  1. Create your first project
   jcode new my‑awesome‑app
   cd my-awesome-app
   npm install
   npm run dev
  1. Add a provider
   jcode provider add aws
  1. Generate a component
   jcode generate component Header
  1. Run tests
   npm test
  1. Deploy – Use Jcode’s built‑in deployment hooks or integrate with your existing CI pipeline.

Feel free to explore the official documentation on GitHub for deeper dives into plugin development, advanced configuration, and architecture patterns.


12. Further Reading & Resources

  • Official GitHub Repo – https://github.com/1jehuang/jcode
  • Documentation – https://jcode.io/docs
  • Community Forum – https://forum.jcode.io
  • Provider Guides – https://jcode.io/providers
  • Docker Hub – https://hub.docker.com/r/jcode/jcode

Happy coding, and let Jcode handle the boilerplate while you focus on building something extraordinary!

Read more