{"id":15107644,"url":"https://github.com/svenvc/neoconsole","last_synced_at":"2025-06-16T22:06:05.814Z","repository":{"id":146208621,"uuid":"151482553","full_name":"svenvc/NeoConsole","owner":"svenvc","description":"NeoConsole offers a command line (REPL) interface to a Pharo image, as well as other tools.","archived":false,"fork":false,"pushed_at":"2024-08-19T21:23:48.000Z","size":101,"stargazers_count":31,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T15:39:41.470Z","etag":null,"topics":["command-line","headless","pharo","repl","smalltalk"],"latest_commit_sha":null,"homepage":"","language":"Smalltalk","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/svenvc.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":"2018-10-03T21:25:59.000Z","updated_at":"2024-08-19T20:50:58.000Z","dependencies_parsed_at":"2024-09-25T21:50:50.335Z","dependency_job_id":null,"html_url":"https://github.com/svenvc/NeoConsole","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.375,"last_synced_commit":"adb83e392e645ef19de136969c3cfecff1dd713a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/svenvc/NeoConsole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenvc%2FNeoConsole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenvc%2FNeoConsole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenvc%2FNeoConsole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenvc%2FNeoConsole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svenvc","download_url":"https://codeload.github.com/svenvc/NeoConsole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenvc%2FNeoConsole/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260249958,"owners_count":22980763,"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":["command-line","headless","pharo","repl","smalltalk"],"created_at":"2024-09-25T21:40:44.694Z","updated_at":"2025-06-16T22:06:05.792Z","avatar_url":"https://github.com/svenvc.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NeoConsole\n\nNeoConsole offers a command line (REPL) interface to a Pharo image, as well as other tools.\n\n[![CI](https://github.com/svenvc/NeoConsole/actions/workflows/CI.yml/badge.svg)](https://github.com/svenvc/NeoConsole/actions/workflows/CI.yml)\n\n## Overview\n\nThe NeoConsole project includes a number of tools\nto improve command line interaction with a Pharo image.\n\n- a set of command objects\n- a command line handler \n- a direct stdin/stdout REPL for experimentation\n- a REPL server for connecting to a running image\n- a metrics package\n- an HTTP handler to access metrics for monitoring\n- a store of configuration key/values incuding environment variables\n- a Transcript replacement to log to a daily rotated file or stdout\n\n\n## REPL\n\nA REPL, a read-eval-print-loop, is textual interface to a Pharo image.\nYou type commands or expressions to evaluate that are read.\nNext this input is evaluated (parsed and executed) with possible side effects.\nFinally, the result is printed.\nThis continues in a loop.\n\nNeoConsole has a set of command objects that can be invoked,\none of which is the eval command that is the default.\nAlthough a bunch of commands are simple single line expressions,\nsome, including eval, are multi line and are terminated by a blank line.\n\nStarting the direct stdin/stdout REPL can be done as follows:\n\n```\n$ ./pharo Pharo.image NeoConsole repl\nNeoConsole Pharo-9.0.0+build.1201.sha.e4cffcf6af8c3a6d5f81ee0cc292bee7c91f2ae4 (64 Bit)\npharo\u003e get system.timestamp\n2021-03-24T11:01:52.488876+01:00\npharo\u003e 42 factorial\n\n1405006117752879898543142606244511569936384000000000\npharo\u003e quit\nBye!\n```\n\nIn your headless Pharo server image, start a REPL process, locally bound, like this:\n\n    NeoConsoleTelnetServer new start.\n\nAlternatively, you can also do:\n\n    $ ./pharo Pharo.image NeoConsole server \u0026\n    [1] 40432\n    Started a NeoConsoleTelnetServer(running 4999)\n    \nFrom a shell, on the same machine only, you can now interact with your headless Pharo server image, like this:\n\n````\n$ telnet localhost 4999\nTrying ::1...\ntelnet: connect to address ::1: Connection refused\nTrying 127.0.0.1...\nConnected to localhost.\nEscape character is '^]'.\nNeo Console Pharo-9.0.0+build.1201.sha.e4cffcf6af8c3a6d5f81ee0cc292bee7c91f2ae4 (64 Bit)\npharo\u003e help\nhelp \u003ccommand\u003e\nknown commands are:\n  add\n  describe\n  eval DEFAULT\n  get\n  halt\n  help\n  history\n  quit\n  save\n  show\npharo\u003e get\nknown metrics:\n  memory.free - Free memory\n  memory.gc - Garbage collect, return free memory\n  memory.total - Total allocated memory\n  process.count - Current process count\n  process.list - Current list of processes\n  system.date - Current date\n  system.mcversions - Monticello packages version info\n  system.status - Simple system status\n  system.time - Current time\n  system.timestamp - Current timestamp\n  system.uptime - Image uptime human readeable\n  system.uptimeseconds - Image uptime seconds\n  system.version - Image version info\npharo\u003e get system.status\nStatus OK - Clock 2021-03-24T11:08:13.387309+01:00 - Allocated 125,444,096 bytes - 21.05 % free.\npharo\u003e 42 factorial\n\n1405006117752879898543142606244511569936384000000000\npharo\u003e NeoConsoleTelnetServer allInstances\n\nan Array(a NeoConsoleTelnetServer(running 4999))\npharo\u003e SystemVersion current\n\nPharo-9.0.0+build.1201.sha.e4cffcf6af8c3a6d5f81ee0cc292bee7c91f2ae4 (64 Bit)\npharo\u003e ==\nself: Pharo-9.0.0+build.1201.sha.e4cffcf6af8c3a6d5f81ee0cc292bee7c91f2...etc...\nclass: SystemVersion\ndate: 11 March 2021\nhighestUpdate: nil\ntype: 'Pharo'\nmajor: 9\nminor: 0\npatch: 0\nsuffix: ''\nbuild: 1201\ncommitHash: 'e4cffcf6af8c3a6d5f81ee0cc292bee7c91f2ae4'\npharo\u003e quit\nBye!\nConnection closed by foreign host.\n````\n\n\n## HTTP Metrics\n\nThe class NeoConsoleMetricDelegate implements the handling of a resource space to access all known metrics.\nYou can start a safe (locally bound) \u0026 dedicated HTTP server as follows:\n\n````\nNeoConsoleMetricDelegate startOn: 1707\n````\n\nWhich you can then access (locally on the same machine) with any HTTP client:\n\n````\n$ curl http://localhost:1707/metrics\n/metrics/memory.free - Free memory\n/metrics/memory.gc - Garbage collect, return free memory\n/metrics/memory.total - Total allocated memory\n/metrics/process.count - Current process count\n/metrics/process.list - Current list of processes\n/metrics/system.date - Current date\n/metrics/system.mcversions - Monticello packages version info\n/metrics/system.status - Simple system status\n/metrics/system.time - Current time\n/metrics/system.timestamp - Current timestamp\n/metrics/system.uptime - Image uptime human readeable\n/metrics/system.uptimeseconds - Image uptime seconds\n/metrics/system.version - Image version info\n\n$ curl http://localhost:1707/metrics/system.version\nPharo-11.0.0+build.323.sha.e6c76cf1e64aa02779926645ff2d31101aee6273 (64 Bit)\n\n$ curl http://localhost:1707/metrics/system.status\nStatus OK - Clock 2022-12-03T16:53:32.669806+01:00 - Allocated 219,152,384 bytes - 17.72 % free.\n````\n\n\n## Metrics\n\nMetrics are implemented using the class NeoConsoleMetric which also keeps a list of all known/defined metrics.\nThis is how you would define a new metric:\n\n````\nNeoConsoleMetric addNamed: 'test.random' description: 'A random test' reader: [ 1e9 atRandom asString ].\n````\n\nThe URI to access your new metric would then be /metrics/test.random\n\nThe reader block is evaluated each time the value of the metric is needed.\n\n\n## Installation\n\nYou can load NeoConsole using Metacello\n\n```Smalltalk\nMetacello new\n  repository: 'github://svenvc/NeoConsole/src';\n  baseline: 'NeoConsole';\n  load.\n```\n\nYou can use the following dependency from your own Metacello configuration or baseline\n\n```Smalltalk\nspec baseline: 'NeoConsole' with: [ spec repository: 'github://svenvc/NeoConsole/src' ].\n```\n\nWhen you download Pharo using the Zeroconf tools (https://get.pharo.org),\nyou can add the NeoConsole code to your image as follows:\n\n```\n$ ./pharo Pharo.image metacello install github://svenvc/NeoConsole/src BaselineOfNeoConsole\n\nMetacelloNotification: Fetched -\u003e BaselineOfNeoConsole-CompatibleUserName.1616520420 --- git@github.com:svenvc/NeoConsole.git[master] --- git@github.com:svenvc/NeoConsole.git[master]\nMetacelloNotification: Loading -\u003e BaselineOfNeoConsole-CompatibleUserName.1616520420 --- git@github.com:svenvc/NeoConsole.git[master] --- git@github.com:svenvc/NeoConsole.git[master]\nMetacelloNotification: Loaded -\u003e BaselineOfNeoConsole-CompatibleUserName.1616520420 --- git@github.com:svenvc/NeoConsole.git[master] --- git@github.com:svenvc/NeoConsole.git[master]\nMetacelloNotification: Loading baseline of BaselineOfNeoConsole...\nMetacelloNotification: Fetched -\u003e Neo-Console-Core-CompatibleUserName.1616520420 --- git@github.com:svenvc/NeoConsole.git[master] --- git@github.com:svenvc/NeoConsole.git[master]\nMetacelloNotification: Loading -\u003e Neo-Console-Core-CompatibleUserName.1616520420 --- git@github.com:svenvc/NeoConsole.git[master] --- cache\nMetacelloNotification: Loaded -\u003e Neo-Console-Core-CompatibleUserName.1616520420 --- git@github.com:svenvc/NeoConsole.git[master] --- cache\nMetacelloNotification: ...finished baseline\n```\n\nMIT Licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvenvc%2Fneoconsole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvenvc%2Fneoconsole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvenvc%2Fneoconsole/lists"}