{"id":15713571,"url":"https://github.com/crystal-community/icr","last_synced_at":"2025-04-04T09:06:49.659Z","repository":{"id":46776709,"uuid":"50042581","full_name":"crystal-community/icr","owner":"crystal-community","description":"Interactive console for Crystal programming language","archived":false,"fork":false,"pushed_at":"2021-09-26T15:30:55.000Z","size":757,"stargazers_count":505,"open_issues_count":13,"forks_count":40,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-25T01:21:19.725Z","etag":null,"topics":["crystal","repl"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/crystal-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-01-20T16:19:31.000Z","updated_at":"2024-10-22T09:54:26.000Z","dependencies_parsed_at":"2022-09-23T03:27:46.338Z","dependency_job_id":null,"html_url":"https://github.com/crystal-community/icr","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-community%2Ficr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-community%2Ficr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-community%2Ficr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-community%2Ficr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crystal-community","download_url":"https://codeload.github.com/crystal-community/icr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149500,"owners_count":20891954,"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":["crystal","repl"],"created_at":"2024-10-03T21:32:10.335Z","updated_at":"2025-04-04T09:06:49.641Z","avatar_url":"https://github.com/crystal-community.png","language":"Crystal","funding_links":[],"categories":["Official Documentation Translations"],"sub_categories":[],"readme":"# ICR - Interactive Crystal [![Build Status](https://travis-ci.org/crystal-community/icr.svg?branch=master)](https://travis-ci.org/crystal-community/icr)\n\nInteractive console for [Crystal Programming Language](http://crystal-lang.org/).\n\n* [Usage](#usage)\n  * [Require local files](#require-local-files)\n* [Installation](#installation)\n  * [Arch Linux](#arch-linux)\n* [How does it work?](#how-does-it-work)\n* [Commands and special locals](#commands-and-special-locals)\n* [Update check](#update-check)\n* [Development](#development)\n* [Editor Integration](#editor-integration)\n* [Contributors](#contributors)\n\n## Usage\n\nIt's like irb, but for Crystal:\n\n![GIF demo](https://raw.githubusercontent.com/crystal-community/icr/master/demo/demo.gif)\n\n### Require local files\nYou can require local files by relative path (starts with `./`):\n```\nrequire \"./src/my_cool_lib\"\n```\n\nLibs can also be required from the cli:\n\n```\n$ icr -r colorize -r ./src/my_cool_lib\n```\n\n## Installation\nPrerequisites:\n* The latest version of crystal.\n* Readline (for Debian/Ubuntu install `libreadline6-dev` package).\n* LLVM development files.\n\nClone the repo:\n```\ngit clone https://github.com/crystal-community/icr.git\n```\nSwitch to repo-directory:\n```\ncd icr\n```\nBuild:\n```\nmake\n```\n\nInstall:\n\n```\nsudo make install\n```\n\n### As a shard dependency\n\nIf you would like to include icr as a dependency, you can add it to your `shard.yml`\n\n```yml\ndependencies:\n  icr:\n    github: crystal-community/icr\n    branch: master\n```\n\nThen just run `shards install` from your project!\n\nEnjoy!\n\n\n### Arch Linux\n\nArch Linux users can install ICR [from AUR](https://aur.archlinux.org/packages/crystal-icr/).\n\n\n## How does it work?\n* Every time you press `Enter` it adds a new instruction, generates a new crystal program, and executes it.\n* The output is split into 2 parts: regular program output (e.g. output from `puts 10`) and the value returned by the last command.\n* The regular output is saved, and when you type a new instruction, a new program is generated. The saved output is subtracted from the new output, and the difference is printed out. It creates an illusion that only new instructions are executed :)\n\n## Commands and special locals\n\n* `paste` - enables paste mode\n* `debug` - toggles debug mode off and on. In debug mode icr will print the code before executing it\n* `quit` or `exit` - exits current interactive console\n* `reset` - clears out all of the accumulated commands\n* `__` - holds the result of the last expression. Example:\n\n```crystal\nicr \u003e \"5\" + \"2\"\n=\u003e \"52\"\nicr \u003e __.to_i - 10\n=\u003e 42\n\n```\n\n## Update check\n\nICR periodically checks for the new releases on Github. If your current version is out of date, it will simply show you a notice at start.\n\nYou can disable this behavior using `--disable-update-check` CLI flag.\n\n## Development\n\nTo run tests:\n```\nmake test\n```\n\n## Editor integration\n\n - [inf-crystal.el](https://github.com/brantou/inf-crystal.el) - Connects REPL buffer to the ICR subprocess in Emacs\n\n## Contributors\n\n- [greyblake](https://github.com/greyblake) Potapov Sergey - creator, maintainer\n- [BlaXpirit](https://github.com/BlaXpirit) Oleh Prypin - fixes for Crystal 0.16\n- [puppetpies](https://github.com/puppetpies) Brian Hood - support of records\n- [jwoertink](https://github.com/jwoertink) Jeremy Woertink - support of -r option and number of other contributions\n- [veelenga](https://github.com/veelenga) V. Elenhaupt - maintenance\n- [MakeNowJust](https://github.com/MakeNowJust) TSUYUSATO Kitsune - syntax highlight support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-community%2Ficr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystal-community%2Ficr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-community%2Ficr/lists"}