@@ -229,9 +229,15 @@ export const CORE_CLI_COMMANDS = [
229229 group : "hosting" ,
230230 description : "scaffold a stack for a Moshpit-hosted service" ,
231231 synopsis : [
232- [ "moshcode template list" , "what there is" ] ,
232+ [ "moshcode template list [--json] " , "what there is" ] ,
233233 [ "moshcode template install <name>" , "write it here" ] ,
234234 ] ,
235+ flags : [
236+ [ "--into <dir>" , "write somewhere other than the current directory" , "" ] ,
237+ [ "--force" , "overwrite files that are already there" , "" ] ,
238+ [ "--dry-run" , "show changes without writing anything" , "" ] ,
239+ [ "--json" , "machine-readable template list" , "" ] ,
240+ ] ,
235241 examples : [ [ "moshcode template install bun-caddy-sqlite" , "" ] ] ,
236242 seeAlso : [ "site" ] ,
237243 } ,
@@ -261,6 +267,21 @@ export const CORE_CLI_COMMANDS = [
261267 flags : [ [ "--json" , "machine-readable, and suppresses the trailing note" , "" ] ] ,
262268 seeAlso : [ "install" ] ,
263269 } ,
270+ {
271+ name : "trade" ,
272+ group : "tools" ,
273+ description : "look up markets and trade through Alpaca" ,
274+ synopsis : [ [ "moshcode trade <verb> [args…]" , "paper trading is Alpaca's default" ] ] ,
275+ verbs : "TRADE_VERBS" ,
276+ examples : [
277+ [ "moshcode trade ticker AAPL" , "asset lookup" ] ,
278+ [ "moshcode trade analysis AAPL" , "quote/trade/bar snapshot" ] ,
279+ [ "moshcode trade buy AAPL 1" , "preview a market order" ] ,
280+ [ "moshcode trade buy AAPL 1 --submit" , "place it" ] ,
281+ ] ,
282+ seeAlso : [ "tools" , "install" ] ,
283+ note : "buy/sell inject --dry-run unless --submit is present. Alpaca defaults to paper trading; live trading requires its separate --live opt-in." ,
284+ } ,
264285 {
265286 name : "commands" ,
266287 group : "script" ,
@@ -389,6 +410,35 @@ export const UPGRADE_TARGETS = [
389410 { name : "tools" , description : "update all installed workflow tools" } ,
390411] ;
391412
413+ export const TRADE_VERBS = [
414+ { name : "ticker" , description : "look up an asset by ticker" , synopsis : [ [ "moshcode trade ticker <symbol> [flags…]" , "" ] ] } ,
415+ { name : "quote" , description : "get the latest quote" , synopsis : [ [ "moshcode trade quote <symbol> [flags…]" , "" ] ] } ,
416+ { name : "analysis" , description : "get an analysis-ready market snapshot" , synopsis : [ [ "moshcode trade analysis <symbol> [flags…]" , "" ] ] } ,
417+ {
418+ name : "buy" , description : "preview or submit a buy order" ,
419+ synopsis : [
420+ [ "moshcode trade buy <symbol> <qty> [alpaca flags…] [--submit]" , "share quantity" ] ,
421+ [ "moshcode trade buy <symbol> --notional <usd> [--submit]" , "dollar amount" ] ,
422+ ] ,
423+ flags : [ [ "--submit" , "place the order instead of injecting --dry-run" , "preview" ] ] ,
424+ } ,
425+ {
426+ name : "sell" , description : "preview or submit a sell order" ,
427+ synopsis : [
428+ [ "moshcode trade sell <symbol> <qty> [alpaca flags…] [--submit]" , "share quantity" ] ,
429+ [ "moshcode trade sell <symbol> --notional <usd> [--submit]" , "dollar amount" ] ,
430+ ] ,
431+ flags : [ [ "--submit" , "place the order instead of injecting --dry-run" , "preview" ] ] ,
432+ } ,
433+ { name : "watch" , description : "manage watchlists" , synopsis : [ [ "moshcode trade watch [list|create|get|add|remove|delete] [args…]" , "" ] ] } ,
434+ { name : "positions" , description : "list, inspect, or close positions" , synopsis : [ [ "moshcode trade positions [verb] [args…]" , "default: list" ] ] } ,
435+ { name : "orders" , description : "list, inspect, replace, or cancel orders" , synopsis : [ [ "moshcode trade orders [verb] [args…]" , "default: list" ] ] } ,
436+ { name : "account" , description : "show account details" , synopsis : [ [ "moshcode trade account [args…]" , "" ] ] } ,
437+ { name : "login" , description : "authenticate an Alpaca profile" , synopsis : [ [ "moshcode trade login [alpaca profile flags…]" , "paper by default" ] ] } ,
438+ { name : "clock" , description : "show market status and next open/close" , synopsis : [ [ "moshcode trade clock [args…]" , "" ] ] } ,
439+ { name : "raw" , description : "invoke the native Alpaca command tree" , synopsis : [ [ "moshcode trade raw <alpaca args…>" , "" ] ] } ,
440+ ] ;
441+
392442/**
393443 * `dns` sub-verbs.
394444 *
@@ -406,6 +456,7 @@ export const DNS_VERBS = [
406456 { name : "service" , description : "install or remove the background service" } ,
407457 { name : "tlds" , description : "list the endings claimed in the Pit" } ,
408458 { name : "resolve" , description : "what a name resolves to, and why" } ,
459+ { name : "trust" , description : "trust one name's certificate, after checking it against the registry pin" } ,
409460] ;
410461
411462/** Sub-verb tables, by the name a command's `verbs` field refers to. */
@@ -414,6 +465,7 @@ export const VERB_TABLES = {
414465 SKILL_VERBS ,
415466 UPGRADE_TARGETS ,
416467 DNS_VERBS ,
468+ TRADE_VERBS ,
417469} ;
418470
419471/**
@@ -430,12 +482,16 @@ export const VERB_TABLES = {
430482 * than a second, thinner copy that drifts.
431483 */
432484export const PIT_COMMANDS = [
485+ { name : "new" , pitOnly : true ,
486+ description : "open and switch to another moshcode tab" } ,
433487 { name : "agents" , aliases : [ "agent" , "engines" ] , args : "[name]" , cli : "agents" ,
434488 description : "list engines, or launch one autonomously" } ,
435489 { name : "start" , args : "<engine> [args…]" , cli : "start" ,
436490 description : "raw launch; inject no engine arguments" } ,
437491 { name : "tools" , args : "[name] [args…]" , cli : "tools" ,
438492 description : "list workflow tools, or run one" } ,
493+ { name : "trade" , args : "<verb> [args…]" , cli : "trade" ,
494+ description : "look up markets and preview/place Alpaca orders" } ,
439495 { name : "install" , args : "<engine|tool>" , cli : "install" ,
440496 description : "install an engine or workflow tool" } ,
441497 { name : "upgrade" , aliases : [ "update" ] , args : "[name…]" , cli : "upgrade" ,
0 commit comments