diff --git a/README.md b/README.md index e1cc1a6..b2874de 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ or miss one that does. A test fails the build when it drifts. | `moshcode pwd`
`where` | system | show the current directory and git context | | `moshcode engines` | engines | list engines and installation status | | `moshcode tools` | tools | list workflow tools and installation status | +| `moshcode trade` | tools | look up markets and trade through Alpaca | | `moshcode commands` | script | list built-in moshscript commands | | `moshcode completion` | extend | print a shell completion script | | `moshcode run` | script | run a moshscript | @@ -154,6 +155,59 @@ native setup and authentication commands. CoinPay currently requires Node.js In the TUI, use `/tools`, `/ugig [args…]`, or `/coinpay [args…]`. The native CLI owns the terminal until it exits, then MoshCode returns to the pit. +### Alpaca trading + +Alpaca is a workflow tool, not a coding engine. Install its official Go CLI, +use `alpaca` for exact native passthrough, or use `trade` for the shorter market +and order vocabulary: + +```sh +moshcode install alpaca # go install github.com/alpacahq/cli/cmd/alpaca@latest +moshcode trade login # Alpaca profile login; paper trading is the default +moshcode trade ticker AAPL # asset get --symbol-or-asset-id AAPL +moshcode trade quote AAPL # latest quote +moshcode trade analysis AAPL # quote/trade/bar snapshot for analysis +moshcode trade watch # list watchlists +moshcode trade positions # list open positions +moshcode trade orders # list open orders +``` + +`buy` and `sell` are safe previews unless `--submit` is explicit. Other Alpaca +order flags pass through, including limit prices and its separate live-trading +opt-in: + +```sh +moshcode trade buy AAPL 1 # adds --type market --dry-run +moshcode trade buy AAPL 1 --type limit --limit-price 185 +moshcode trade buy AAPL --notional 100 # preview a $100 market buy +moshcode trade buy AAPL 1 --submit # places the paper order +moshcode trade raw data news --symbol AAPL # any native Alpaca command +moshcode alpaca order submit --help # exact native passthrough +``` + +The same facade is `/trade …` in the pit and `trade(…)` in moshscript. +Alpaca's CLI has no confirmation prompts; `--submit` intentionally removes +MoshCode's preview guard. Live trading additionally requires Alpaca's `--live` +opt-in or corresponding environment setting. + +### Social posting from the pit + +The pit can hand a prepared post to Bluesky or Nostr without storing either +account's credentials in MoshCode: + +```text +/socials +/post bsky "shipped it 🤘" +/post nostr "shipped it 🤘" +``` + +Bluesky opens its official compose intent. Nostr opens the MoshCode composer, +connects to a NIP-07 browser signer (or a NIP-46 bunker through +[`window.nostr.js`](https://github.com/fiatjaf/window.nostr.js)), signs a kind-1 +event, and publishes it to the displayed relays. Both flows leave the final +confirmation in the browser. If the pit is remote or headless, `/post` prints +the composer URL instead. + ## Browser terminal (`moshcode console`) A real terminal in the browser — arrow keys, history, full-screen TUIs — because diff --git a/apps/pwa/src/lib/moshpit-name.mjs b/apps/pwa/src/lib/moshpit-name.mjs index f7be06c..7b52d1a 100644 --- a/apps/pwa/src/lib/moshpit-name.mjs +++ b/apps/pwa/src/lib/moshpit-name.mjs @@ -95,6 +95,68 @@ export function parseMoshpitName(input) { return { label: normalizedLabel, tld: normalizedTld }; } +/** + * A label as the records table may hold it: an ordinary label, or the wildcard + * form `*.