{"id":26949847,"url":"https://github.com/rozek/glifrunner","last_synced_at":"2026-02-24T06:05:32.865Z","repository":{"id":278504240,"uuid":"935838018","full_name":"rozek/GlifRunner","owner":"rozek","description":"a simple client that runs given Glifs","archived":false,"fork":false,"pushed_at":"2025-02-20T14:34:56.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-16T15:40:31.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rozek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2025-02-20T05:18:00.000Z","updated_at":"2025-02-20T14:34:59.000Z","dependencies_parsed_at":"2025-02-20T06:36:33.581Z","dependency_job_id":null,"html_url":"https://github.com/rozek/GlifRunner","commit_stats":null,"previous_names":["rozek/glifrunner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rozek/GlifRunner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FGlifRunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FGlifRunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FGlifRunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FGlifRunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rozek","download_url":"https://codeload.github.com/rozek/GlifRunner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FGlifRunner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280749667,"owners_count":26384126,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-04-02T22:18:08.078Z","updated_at":"2025-10-24T06:08:42.224Z","avatar_url":"https://github.com/rozek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GlifRunner #\n\na simple client that runs given Glifs\n\n## Overview ##\n\n[Glif](https://glif.app/glifs) is a simple visual environment to create (simple) AI agents (called \"Glifs\") from predefined but configurable building blocks without having to write a single line of code.\n\nGlifs may be run from the Glif web site (or from any other web page that embeds them) or using the [Glif API](https://docs.glif.app/api/getting-started#running-glifs-using-the-simple-api).\n\nThe `GlifRunner` implements a simple TypeScript/JavaScript client that facilitates the invocation of such Glifs. In the simplest case, you may run a single Glif and wait for its response just by specifying its id and any required input values (plus ypur personal Glif API token, but that may be configured once and used for any Glif request). Or, you may run several Glifs concurrently, in the background, get informed when they finished or cancel them if you no longer need their output.\n\n\u003e **Important: in order to run Glifs via their API, you will have to [sign up for a Glif account](https://glif.app/signin) and [request your personal API Token](https://glif.app/settings/api-tokens)**\n\n\u003e **Warning**: logging the GlifRunner or its instances in the browser console may reveal the configured API Token!\n\n## Installation ##\n\nThe `GlifRunner` may be used as an ECMAScript module (ESM), a CommonJS or AMD module or from a global variable.\n\nYou may either install the package into your build environment using [NPM](https://docs.npmjs.com/) with the command\n\n```\nnpm install glifrunner\n```\n\nor load the plain script file directly\n\n```html\n\u003cscript type=\"module\" src=\"https://rozek.github.io/GlifRunner/dist/GlifRunner.esm.js\"\u003e\u003c/script\u003e\n```\n\n## Access ##\n\nHow to access the package depends on the type of module you prefer\n\n* ESM (or Svelte): `import { GlifRunner } from 'glifrunner'`\n* CommonJS: `const GlifRunner = require('glifrunner')`\n* AMD: `require(['glifrunner'], (GlifRunner) =\u003e {...})`\n\nAlternatively, you may access the global variable `GlifRunner` directly.\n\n## Usage within Svelte ###\n\nFor Svelte, it is recommended to import the package in a module context. From then on, its exports may be used as usual:\n\n```html\n\u003cscript context=\"module\"\u003e\n  import { GlifRunner } from 'glifrunner'\n\u003c/script\u003e\n\n\u003cscript\u003e\n  GlifRunner.APIToken = '...'\n  ;(async () =\u003e {\n    console.log(await GlifRunner.run('cm7c4nbnm000fj9tzb9t3pcgw')) // that's my \"Hello, World!\" Glif\n  })()\n\u003c/script\u003e\n```\n\nYou may experiment with that code [in the Svelte REPL](https://svelte.dev/playground/ae2740d646bb46cc9c95f0fe38a1b25b?version=5.20.2)\n\n## Examples ##\n\nHere are some typical examples.\n\n### Static Usage ###\n\nUsing static methods avoids having to instantiate a GlifRunner and may be the simplest way to invoke Glifs\n\n```javascript\n  GlifRunner.APIToken = '...' // enter your Glif API token here\n  console.log(await GlifRunner.run('cm7c4nbnm000fj9tzb9t3pcgw')) // that's my \"Hello, World!\" Glif\n```\n\n### Instance Usage ###\n\nIf you want to be able to cancel a Glif request (note: the Glif itself continues to run and consume your credits, but it won't respond any longer), you will have to create a GlifRunner instance and use that to invoke your Glif:\n\n```javascript\n  GlifRunner.APIToken = '...' // enter your Glif API token here\n  const Runner = new GlifRunner()\n  const Result = await Runner.run('cm7cslpjn000dynhku4x8kw01') // \"Hello, Image!\" delivering an image\n  console.log('Result',Result)\n```\n\nIn most cases, you will use a single API token for all your Glif invocations (and then it's fine to configure that token statically), but if you still want to use individual tokens for specific Glifs, you may specify different API tokens per GlifRunner instance:\n\n```javascript\n  const Runner = new GlifRunner('...') // enter your Glif API token here\n  const Result = await Runner.run('cm7csu1ol000212y6m6f811wp') // \"Hello, Audio!\" delivering an audio file\n  console.log('Result',Result)\n```\n\nAnd here is how you would cancel a running request\n\n```javascript\n  GlifRunner.APIToken = '...' // enter your Glif API token here\n  const Runner = new GlifRunner()\n  const Result = Runner.run('cm7cslpjn000dynhku4x8kw01') // \"Result\" will now be a Promise\n  Runner.abort()\n```\n\nIf you run several requests concurrently, you may want to be informed when they finish or fail:\n\n```javascript\n  GlifRunner.APIToken = '...' // enter your Glif API token here\n  const Runner = new GlifRunner()\n  Runner.run('cm7cslpjn000dynhku4x8kw01',[],(Outcome,Runner) =\u003e {\n    console.log(Outcome instanceof Error ? 'run failed with' : 'run returned', Outcome)\n    console.log('the runner managing this request was',Runner)\n  })\n```\n\n## API Reference ##\n\n### GlifRunner Class ###\n\n* `constructor (APIToken?:string)`\u003cbr\u003einitializes a new instance of `GlifRunner`, optionally accepting an API token for authentication with the Glif API.\n* `get isRunning ():boolean`\u003cbr\u003ereturns a boolean indicating whether a Glif is currently running.\n* `abort ():void`\u003cbr\u003estops the currently running Glif, if any.\n* `get Response ():object | undefined`\u003cbr\u003ereturns the response from the last executed Glif, or `undefined` if no Glif has been run.\n* `run (GlifId:string, InputValues?:GlifInputs, Callback?:Function):Promise\u003cobject\u003e`\u003cbr\u003eexecutes a Glif identified by `GlifId` with optional input values and a callback function. Returns a promise that resolves to the response object.\n\n### Static Methods ###\n\n* `static get APIToken ():string | undefined`\u003cbr\u003ereturns the global API token used for Glif API authentication.\n* `static set APIToken (APIToken:string | undefined)`\u003cbr\u003esets the global API token for Glif API authentication.\n* `static run (GlifId:string, InputValues:GlifInputs, Callback?:Function):Promise\u003cobject\u003e`\u003cbr\u003eprovides a convenience method to run a Glif without needing to instantiate a `GlifRunner`. Returns a promise that resolves to the response object.\n\n### Type Reference ###\n\n* `GlifInputs`\u003cbr\u003erepresents the input values for a Glif, which can be either an array of strings or an object with string key-value pairs.\n\n## Build Instructions ##\n\nYou may easily build this package yourself.\n\nJust install [NPM](https://docs.npmjs.com/) according to the instructions for your platform and follow these steps:\n\n1. either clone this repository using [git](https://git-scm.com/) or [download a ZIP archive](https://github.com/rozek/GlifRunner/archive/refs/heads/main.zip) with its contents to your disk and unpack it there \n2. open a shell and navigate to the root directory of this repository\n3. run `npm install` in order to install the complete build environment\n4. execute `npm run build` to create a new build\n\nYou may also look into the author's [build-configuration-study](https://github.com/rozek/build-configuration-study) for a general description of his build environment.\n\n## License ##\n\n[MIT License](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozek%2Fglifrunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frozek%2Fglifrunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozek%2Fglifrunner/lists"}