{"id":17667655,"url":"https://github.com/ikasoba/aish","last_synced_at":"2025-05-08T05:53:54.342Z","repository":{"id":208235460,"uuid":"721140490","full_name":"ikasoba/aish","owner":"ikasoba","description":"aish - aiscript shell.","archived":false,"fork":false,"pushed_at":"2023-11-20T15:34:46.000Z","size":11,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T05:53:48.146Z","etag":null,"topics":["aiscript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ikasoba.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-20T12:46:07.000Z","updated_at":"2023-11-20T13:12:44.000Z","dependencies_parsed_at":"2024-10-24T01:16:05.433Z","dependency_job_id":"47613fbd-777a-4596-95be-1d2377b425c1","html_url":"https://github.com/ikasoba/aish","commit_stats":null,"previous_names":["ikasoba/aish"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikasoba%2Faish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikasoba%2Faish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikasoba%2Faish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikasoba%2Faish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ikasoba","download_url":"https://codeload.github.com/ikasoba/aish/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253009850,"owners_count":21839713,"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":["aiscript"],"created_at":"2024-10-23T22:22:42.228Z","updated_at":"2025-05-08T05:53:54.326Z","avatar_url":"https://github.com/ikasoba.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aish - aiscript shell\n\n* This software is unofficial and not related to [aiscript-dev](https://github.com/aiscript-dev/).\n\n```plain\n$ aish -h\n\nUsage:   aish\nVersion: 0.1.0\n\nOptions:\n\n  -h, --help     - Show this help.\n  -V, --version  - Show the version number for this program.\n\nCommands:\n\n  run   \u003cpath\u003e  - execute script file.\n  repl          - run repl.\n\n$ aish repl\n\u003e Core:ai\n\"kawaii\"\n```\n\n# Installation\n\n```sh\ndeno install -A -n aish --import-map https://raw.githubusercontent.com/ikasoba/aish/main/import_map.json https://raw.githubusercontent.com/ikasoba/aish/main/cli.ts\n```\n\n# About\n\naish automatically turns undeclared variables into helpers for executing commands.\n\nYou can also declare variables in the same way as in regular aiscript.\n```plain\n\u003e echo(\"Hello, world!\").exec()\nHello, world!\nnull\n\u003e echo(1).pipe(xargs(\"expr\", 1, \"+\")).exec()\n2\nnull\n```\n\n# API Reference\n\n## Command#exec(): null\nThe `exec` method of the command outputs standard output and standard error as is and returns `null`.\n\n## Command#read(): str | error\nCommand's `read` method is used to retrieve stdout and stderr.\n\nOnly in case of an error, the standard error is returned.\n\n## FakeModule:import(path: str): obj\n\n- This feature is experimental.\n\nThis feature can be used to load external aiscript code.\n\nAs a precaution, some features such as namespaces will not be available.\n\nThis is because aish internally executes the contents of the code as a function.\n\nModule loading is performed according to the following rules\n\n- If the `path` starts with `/`, then\n\n  Load from `\u003chome\u003e/.aish/`.\n\n- Otherwise.\n\n  Import from the same hierarchy as the running script file.\n\nAlso, JavaScript can be loaded.\n\n### example\n\n```js\n// ./hoge.is\n\n@add(x, y) {\n  return x + y\n}\n\nreturn {\n  add: add\n}\n```\n\n\n```js\n// ./hoge.js\n\nimport { values, utils } from \"@syuilo/aiscript/\";\n\nexport default () =\u003e (\n  values.OBJ(new Map([\n    [\"add\", values.FN_NATIVE(([x, y]) =\u003e {\n      utils.assertNumber(x);\n      utils.assertNumber(y);\n\n      return values.NUM(x.value + y.value);\n    })]\n  ]))\n)\n```\n\n```js\nlet Hoge = FakeModule:import(\"./hoge.is\")\n\n\u003c: Hoge.add(1, 2)\n\n// or\n\nlet Hoge = FakeModule:import(\"./hoge.js\")\n\n\u003c: Hoge.add(1, 2)\n```\n\n# .aishrc\n\n`aish` has a `.bashrc` like feature called `.aishrc`.\n\nIt must be placed as valid AiScript code directly under the user's home directory (such as `/home/user/.aishrc`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikasoba%2Faish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fikasoba%2Faish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikasoba%2Faish/lists"}