Skip to content

Commit b02982d

Browse files
committed
Add commands
1 parent 164c3d4 commit b02982d

3 files changed

Lines changed: 280 additions & 0 deletions

File tree

‎assets/commands/hc2html.md‎

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# TAGLINE
2+
3+
Convert HyperCard 2.x stacks into self-contained HTML pages
4+
5+
# TLDR
6+
7+
**Convert** a stack, writing HTML next to the source file
8+
9+
```hc2html ["My Stack"]```
10+
11+
**Write** the page to a chosen file
12+
13+
```hc2html ["My Stack"] -o [my-stack.html]```
14+
15+
**Map** a classic Mac font to a CSS font stack
16+
17+
```hc2html ["My Stack"] --font "[GoodDogPlain=Gochi Hand, cursive]"```
18+
19+
**Keep** field edits and new cards in the browser
20+
21+
```hc2html ["My Stack"] --persist```
22+
23+
**Strip** HyperTalk scripts for a static viewer
24+
25+
```hc2html ["My Stack"] --no-scripts```
26+
27+
**Also dump** pictures, icons, and sounds as files
28+
29+
```hc2html ["My Stack"] --dump-assets [assets]```
30+
31+
**Decode** a Central European stack
32+
33+
```hc2html ["My Stack"] --encoding [mac_latin2]```
34+
35+
**Also write** the intermediate JSON model
36+
37+
```hc2html ["My Stack"] --json [model.json]```
38+
39+
# SYNOPSIS
40+
41+
**hc2html** _STACK_ [**-o** _OUT.html_] [**--encoding** _ENC_] [**--title** _T_] [**--chrome** window|none] [**--persist**] [**--lenient**] [**--no-scripts**] [**--font** _NAME=CSS_] [**--start-card** _N_] [**--json** _FILE_] [**--dump-assets** _DIR_] [**-q**]
42+
43+
# PARAMETERS
44+
45+
**STACK**
46+
> HyperCard 2.x stack file (data fork, or a MacBinary **.bin**).
47+
48+
**-o**, **--output** _FILE_
49+
> Output HTML path. Default is the stack path with **.html** appended (**.bin** is stripped first).
50+
51+
**--encoding** _ENC_
52+
> Mac text encoding of the stack. Default **mac_roman**. Other Python **mac_*** codecs work, including **mac_latin2**, **mac_cyrillic**, **mac_greek**, **mac_turkish**, and **mac_iceland**.
53+
54+
**--title** _T_
55+
> HTML page title. Default is the stack name.
56+
57+
**--chrome** **window**|**none**
58+
> Draw a classic Mac menu bar and window around the card (**window**, the default), or output the card alone.
59+
60+
**--persist**
61+
> Store field edits, hilites, and cards created with **doMenu "New Card"** in the browser's localStorage.
62+
63+
**--lenient**
64+
> Log unknown HyperTalk to the browser console instead of showing a HyperCard-style error dialog.
65+
66+
**--no-scripts**
67+
> Omit all HyperTalk from the viewer (static page).
68+
69+
**--font** _NAME=CSS_
70+
> Map a Mac font name to a CSS font stack. Repeatable.
71+
72+
**--start-card** _N_
73+
> 1-based card number to open first. Default **1**.
74+
75+
**--json** _FILE_
76+
> Also write the intermediate JSON model (pictures as data URIs).
77+
78+
**--dump-assets** _DIR_
79+
> Also write every picture, icon, pattern, and sound as files under _DIR_.
80+
81+
**-q**, **--quiet**
82+
> Do not print the conversion summary.
83+
84+
**--version**
85+
> Print **hc2html** _version_ and exit.
86+
87+
# DESCRIPTION
88+
89+
**hc2html** reads a HyperCard 2.x stack and writes one self-contained HTML file. Card and background pictures, icons, sounds, font metadata, and scripts are embedded, so the page opens in a modern browser with no server.
90+
91+
It parses HyperCard formats **8** (2.0/2.1) and **10** (2.2 and later): stack header, backgrounds, cards, button and field parts, unshared background field contents, unshared button hilites, the font table, card order from **LIST**/**PAGE** blocks, and WOBA-compressed pictures. Pictures are decoded to PNG with an alpha channel so unpainted card pixels show the background.
92+
93+
The resource fork supplies **ICON**, **ICN#** (favicon), **CURS**, and **snd** resources (formats 1 and 2, uncompressed 8/16-bit, converted to WAV). The fork is looked up in this order: a native **..namedfork/rsrc** on macOS, **Stack.rsrc** beside the data fork, an AppleDouble **._Stack** file, or the stack itself as MacBinary **.bin**.
94+
95+
The viewer draws the usual button and field styles, XOR hilites, and a HyperTalk subset (message hierarchy, chunks, **put**/**get**/**set**, **if**/**repeat**, **go**, visual effects, **answer**/**ask**, **play**, object properties, and common functions). Unknown statements raise a "Can't understand" dialog unless **--lenient** is set. Well-known externals such as **AddColor** are ignored with a console note.
96+
97+
There are no Python package dependencies. The converter runs on Python 3.9+; the viewer is plain JavaScript.
98+
99+
# CAVEATS
100+
101+
HyperCard **1.x** stacks (format less than 8) are rejected; open them in HyperCard 2.x once and save. Paint tools, XCMDs/XFCNs, script-created menus, printing, file I/O, AppleScript, styled text runs inside fields, **privateAccess**, and encrypted stacks are not implemented.
102+
103+
Icons and sounds are missing without a resource fork. Copying a stack through Windows, zip, or the web often drops the fork unless the file is MacBinary or kept with its **._** AppleDouble sidecar.
104+
105+
# HISTORY
106+
107+
**hc2html** 0.1.0 is an MIT-licensed preservation tool. Its WOBA decoder is a Python port of Rebecca Bettencourt's MIT-licensed C++ decoder from Uli Kusterer's **stackimport**. HyperCard itself was Apple's 1987 Macintosh authoring environment; this converter contains no HyperCard code or artwork, only a reader for the file format.
108+
109+
# SEE ALSO
110+
111+
[unar](/man/unar)(1), [python3](/man/python3)(1), [file](/man/file)(1), [pandoc](/man/pandoc)(1)
112+
113+
# RESOURCES
114+
115+
```[Source code](https://github.com/stachon/hc2html)```
116+
117+
<!-- verified: 2026-09-05 -->

‎assets/commands/index.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3276,6 +3276,7 @@ havn.md
32763276
haxelib.md
32773277
hazelnut.md
32783278
hbpldecode.md
3279+
hc2html.md
32793280
hciconfig.md
32803281
hciemu.md
32813282
hcitool.md
@@ -4720,6 +4721,7 @@ mmroff.md
47204721
mmv.md
47214722
mn.md
47224723
mnemo.md
4724+
mobilecode.md
47234725
moc.md
47244726
mocha.md
47254727
mock.md

‎assets/commands/mobilecode.md‎

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# TAGLINE
2+
3+
Open-source AI coding agent with iOS and Android device previews
4+
5+
# TLDR
6+
7+
**Launch** the interactive TUI
8+
9+
```mobilecode```
10+
11+
**Open** a specific project directory
12+
13+
```mobilecode [path/to/project]```
14+
15+
**Run** a prompt non-interactively
16+
17+
```mobilecode run "[fix the crash in MainActivity]"```
18+
19+
**Use** a specific model
20+
21+
```mobilecode --model [anthropic/claude-sonnet-4]```
22+
23+
**Continue** the last session
24+
25+
```mobilecode --continue```
26+
27+
**Log in** to an AI provider
28+
29+
```mobilecode auth login```
30+
31+
**List** available models
32+
33+
```mobilecode models```
34+
35+
**Start** a headless server
36+
37+
```mobilecode serve --port [4096]```
38+
39+
**Open** the web interface
40+
41+
```mobilecode web```
42+
43+
# SYNOPSIS
44+
45+
**mobilecode** [_command_] [_options_] [_project_]
46+
47+
# PARAMETERS
48+
49+
**--model**, **-m** _PROVIDER/MODEL_
50+
> Model to use, in **provider/model** form (for example **anthropic/claude-sonnet-4**).
51+
52+
**--continue**, **-c**
53+
> Resume the last session.
54+
55+
**--session**, **-s** _ID_
56+
> Continue a specific session by ID.
57+
58+
**--fork**
59+
> Fork the session before continuing (requires **--continue** or **--session**).
60+
61+
**--prompt** _TEXT_
62+
> Initial prompt when launching the TUI.
63+
64+
**--agent** _NAME_
65+
> Agent to use (build, plan, or a custom agent).
66+
67+
**--auto**
68+
> Auto-approve permissions that are not explicitly denied.
69+
70+
**--mini**
71+
> Start the minimal interactive interface instead of the full TUI.
72+
73+
**--print-logs**
74+
> Print logs to stderr.
75+
76+
**--log-level** _LEVEL_
77+
> **DEBUG**, **INFO**, **WARN**, or **ERROR**.
78+
79+
**--pure**
80+
> Run without external plugins.
81+
82+
**-h**, **--help**
83+
> Show help.
84+
85+
**-v**, **--version**
86+
> Show version.
87+
88+
# COMMANDS
89+
90+
**run** [_message_...]
91+
> Send a prompt non-interactively and exit. **--format** **default**|**json**, **--file** _path_, **--dir** _path_, **--attach** _url_.
92+
93+
**serve**
94+
> Start a headless MobileCode server.
95+
96+
**web**
97+
> Start the server and open the web interface.
98+
99+
**attach** _url_
100+
> Connect the TUI to a running server (for example **http://localhost:4096**).
101+
102+
**auth**, **providers**
103+
> Manage AI provider credentials. **login**, **logout**, **list**.
104+
105+
**models** [_provider_]
106+
> List models. **--verbose**, **--refresh**.
107+
108+
**session list**
109+
> List saved sessions. **session delete** _ID_ removes one.
110+
111+
**stats**
112+
> Token usage and cost.
113+
114+
**mcp**
115+
> Register and manage MCP servers.
116+
117+
**console login**
118+
> Log in to the OpenCode console.
119+
120+
# DESCRIPTION
121+
122+
**mobilecode** is a fork of **opencode** aimed at mobile apps. It keeps OpenCode's terminal UI, desktop app, web UI, model providers, MCP, plugins, and skills. When it finds an iOS or Android project it can start a simulator or emulator preview and show the live device next to the session.
123+
124+
iOS detection covers Xcode projects and workspaces, CocoaPods, and Expo apps, then runs **serve-sim**. Android detection covers Gradle projects and Expo apps, then runs **serve-avd**. Projects are searched up to two directories below the session root.
125+
126+
The device pane starts with the session. A titlebar run control builds, installs, and launches the app: **xcodebuild** plus **simctl** on iOS, **./gradlew :**_module_**:assembleDebug** plus **adb** on Android. The same operations are exposed over HTTP as **/api/device-preview**.
127+
128+
The default command with no subcommand starts the TUI in the current directory (or in _project_ if given).
129+
130+
# CONFIGURATION
131+
132+
**~/.config/opencode**
133+
> Config directory, including **opencode.json**. Existing OpenCode provider credentials, plugins, and skills apply unchanged.
134+
135+
**~/.local/share/opencode**
136+
> Data directory (sessions, **auth.json**, and related state).
137+
138+
**OPENCODE_***
139+
> Environment variables keep the OpenCode prefix, including **OPENCODE_SERVER_PASSWORD** and **OPENCODE_SERVER_USERNAME** for **serve** / **web**.
140+
141+
The install script places the binary in **~/.mobilecode/bin** and prepends that directory to PATH.
142+
143+
# CAVEATS
144+
145+
iOS preview needs macOS with Xcode (**serve-sim** wants Node 20 or newer). Android preview needs the SDK platform-tools, at least one AVD, a JDK that the project's Gradle version supports, and **aapt2** from the SDK build-tools to read the package name from a built APK.
146+
147+
The curl installer downloads a GitHub release tarball or zip into **~/.mobilecode/bin**. From source, clone the repo and run **bun run --cwd packages/opencode src/index.ts**. Cloud models need provider credentials (**mobilecode auth login**). The TUI needs a capable terminal.
148+
149+
# HISTORY
150+
151+
**MobileCode** is an MIT-licensed fork of **OpenCode** (anomalyco/opencode) by **hsandhu**. OpenCode is the SST team's open-source coding agent. This fork adds simulator and emulator previews via **serve-sim** and **serve-avd** while keeping OpenCode's CLI shape, config paths, and license.
152+
153+
# SEE ALSO
154+
155+
[opencode](/man/opencode)(1), [claude](/man/claude)(1), [aider](/man/aider)(1), [xcodebuild](/man/xcodebuild)(1), [adb](/man/adb)(1)
156+
157+
# RESOURCES
158+
159+
```[Source code](https://github.com/hsandhu/mobilecode)```
160+
161+
<!-- verified: 2026-09-05 -->

0 commit comments

Comments
 (0)