code

Open a PHP, JavaScript or configuration file with code <file> when syntax colors help you read it. The command opens an editor in the browser; it does not run the file. For quick plain text changes, edit uses fewer interface assets.

DevelopmentVersion 1.3.7Stable
lil-terminal

Overview

The extension usually determines the language. -l <lang> or -<lang> selects it explicitly, for example for a generated file. -n creates a missing file only if its parent folder exists. Existing files are not cleared.

Edit source without leaving the browser

The Base interface can load optional code CSS and JavaScript via include. Without those assets, code editing remains available as plain text. Only writable text files up to 2 MiB and 100000 lines are accepted; binary files are rejected.

Syntax

lil-terminal
code <file> [-n] [-l <lang>|-<lang>]

Reference

code <file>

open a file in the code editor

-n

create a missing file before opening it

-l <lang> | -<lang>

select php, html, xml, css, js, json, ini, md, py, sql, sh or lil highlighting

include -code -i @include

inspect the automatically managed editor interface package

include -code -u @include

remove optional editor assets without removing code

help hotkeys

show editor keyboard shortcuts

Editing source, not executing it

Open a PHP, JavaScript or configuration file with code <file> when syntax colors help you read it. The command opens an editor in the browser; it does not run the file. For quick plain text changes, edit uses fewer interface assets.

Language and files

The extension usually determines the language. -l <lang> or -<lang> selects it explicitly, for example for a generated file. -n creates a missing file only if its parent folder exists. Existing files are not cleared.

What Base adds

The Base interface can load optional code CSS and JavaScript via include. Without those assets, code editing remains available as plain text. Only writable text files up to 2 MiB and 100000 lines are accepted; binary files are rejected.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Open PHP source

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install code
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install code -m
Exact public version

Install exactly this published version.

install code -v 1.3.7
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade code
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install code -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Open PHP source
cd \sandbox | code src/Calculator.php
[Browser editor: existing PHP source]
<?php

declare(strict_types=1);

final class Calculator
{
    public static function add(int $left, int $right): int
Create JavaScript file
code \sandbox\tmp\review.js -n
[Browser editor: new empty file]
sandbox/tmp/review.js
Language: js
Choose JSON highlighting
code \sandbox\config\app.json -json
[Browser editor: existing file]
sandbox/config/app.json
Language: json (selected)
Highlight a lil script
code \sandbox\scripts\demo.lil -l lil
[Browser editor: existing file]
sandbox/scripts/demo.lil
Language: lil (selected)
Specify INI for an unusual name
code \sandbox\config\.env.example -ini
[Browser editor: existing file]
sandbox/config/.env.example
Language: ini (selected)
Open a plain-text file
code \sandbox\data\sample.txt -l text
[Browser editor: existing file]
lil-terminal sandbox text file

This file is safe to read, copy, rename, replace, hash and archive.
Inspect code editor assets
include -code -i
Package     code
Components  CSS + JavaScript
Status      available separately from code

These commands install the optional editor assets. The code command still has a safe basic-editor fallback when they are absent.

Remove optional editor assets
include -code -u
Package     code
CSS/JS      removed when present
Command     still installed

These commands install the optional editor assets. The code command still has a safe basic-editor fallback when they are absent.

Check editor shortcuts
help hotkeys
hotkeys
Keyboard shortcuts are listed for the installed interface
Handle a missing file
code \sandbox\missing.php
File not found
Reject an unknown language
code \sandbox\data\sample.txt -l unsupported
Unsupported language

File used in this example: sandbox/src/Calculator.php

The example uses a file or directory from the protected /sandbox/ documentation workspace.

<?php

declare(strict_types=1);

final class Calculator
{
    public static function add(int $left, int $right): int
    {
        return $left + $right;
    }
}

Related documentation

Current public release

v1.3.72026-10-31

Production refinement

Current stable release of code. Open a PHP, JavaScript or configuration file with code <file> when syntax colors help you read it.