{"id":20434596,"url":"https://github.com/arstgit/cmd-alive","last_synced_at":"2026-06-04T12:31:22.313Z","repository":{"id":57201111,"uuid":"156802262","full_name":"arstgit/cmd-alive","owner":"arstgit","description":"Interactive fiction engine.","archived":false,"fork":false,"pushed_at":"2018-11-10T06:27:10.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-15T21:47:53.274Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arstgit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-09T03:01:11.000Z","updated_at":"2018-11-10T06:17:22.000Z","dependencies_parsed_at":"2022-09-15T11:22:59.343Z","dependency_job_id":null,"html_url":"https://github.com/arstgit/cmd-alive","commit_stats":null,"previous_names":["derekchuank/cmd-alive"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fcmd-alive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fcmd-alive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fcmd-alive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fcmd-alive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arstgit","download_url":"https://codeload.github.com/arstgit/cmd-alive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241977159,"owners_count":20051777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:27:48.081Z","updated_at":"2026-06-04T12:31:22.307Z","avatar_url":"https://github.com/arstgit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cmd-alive\n\n[![Build Status](https://travis-ci.org/derekchuank/cmd-alive.svg?branch=master)](https://travis-ci.org/derekchuank/cmd-alive)\n[![npm version](https://badge.fury.io/js/cmd-alive.svg)](http://badge.fury.io/js/cmd-alive)\n\n## For Reader\n\nInstall.\n\n```\nnpm install -g cmd-alive\n```\n\nThere is a demo in the package, you can try it.\n\n```\nalive\n```\nSure, if you want to read other ficitions.\n\n```\nalive [path to fiction directory]\n```\n\n### Command\n\nWhile reading you can type these commands.\n\n* `help` - Show help information.\n* `save` - Save your progress. Besides, `Ctrl-C` can also trigger it automatically. Progerss file is in your fiction directory with name `.cache`.\n* `restart` - Deleted your saved profile, and start over.\n* `print` - Print your track, used for debug.\n\n## For Writer\n\nDemo file is in `/example/shelter`. Every fiction contain two types of files.\n\n`.ca` - Files extension with `.ca` is fiction script.Every fiction contain servel sections, each begain with a label name having the form `$...:`. Section must ending with choices would be selectd by reader. Two special label is indispensable: `start` and `end`.\n\n`js` - Files extension with `.js` is control flow script. Every function name must be a label identity, so too return value. These is a global object `ctx` you can access in this file freely.\n\n## Example\n\n`.ca`:\n\n```\n$start: \nA nice day.\n\nchoices:\n\na. go to 2a.\nb. go to A LOOP.\n\n\n$2a: \nThen?\nNo choice.\n\n$loop: \nYou can't excape.\n\n$end: \nThink you.\n```\n\n`.js`\n\n```\nfunction $start() {\n  if (ctx.cur === \"b\") {\n    return $loop;\n  }\n  if (ctx.cur == \"a\") {\n    return $2a;\n  }\n  return $start;\n}\n\nfunction $2a() {\n  return $end;\n}\n\nfunction $loop() {\n  return $start;\n}\nfunction $end() {\n  // dumb\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farstgit%2Fcmd-alive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farstgit%2Fcmd-alive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farstgit%2Fcmd-alive/lists"}