{"id":17682238,"url":"https://github.com/stephendolan/spark","last_synced_at":"2025-05-12T23:12:40.672Z","repository":{"id":43833293,"uuid":"354096633","full_name":"stephendolan/spark","owner":"stephendolan","description":"A set of CLI utilities to facilitate advanced application setup and building.","archived":false,"fork":false,"pushed_at":"2022-07-05T20:21:24.000Z","size":244,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-01T04:32:46.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://stephendolan.github.io/spark/","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/stephendolan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"stephendolan"}},"created_at":"2021-04-02T18:06:35.000Z","updated_at":"2024-08-22T04:24:12.000Z","dependencies_parsed_at":"2022-09-25T01:52:04.163Z","dependency_job_id":null,"html_url":"https://github.com/stephendolan/spark","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephendolan%2Fspark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephendolan%2Fspark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephendolan%2Fspark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephendolan%2Fspark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephendolan","download_url":"https://codeload.github.com/stephendolan/spark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837463,"owners_count":21971984,"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-10-24T09:13:18.025Z","updated_at":"2025-05-12T23:12:40.652Z","avatar_url":"https://github.com/stephendolan.png","language":"Crystal","funding_links":["https://github.com/sponsors/stephendolan"],"categories":[],"sub_categories":[],"readme":"# Spark\n\n![Shard CI](https://github.com/stephendolan/spark/workflows/Shard%20CI/badge.svg)\n[![API Documentation Website](https://img.shields.io/website?down_color=red\u0026down_message=Offline\u0026label=API%20Documentation\u0026up_message=Online\u0026url=https%3A%2F%2Fstephendolan.github.io%2Fspark%2F)](https://stephendolan.github.io/spark)\n[![GitHub release](https://img.shields.io/github/release/stephendolan/spark.svg?label=Release)](https://github.com/stephendolan/spark/releases)\n\n## Installation\n\nAdd the dependency to your `shard.yml`:\n\n```yaml\ndependencies:\n  spark:\n    github: stephendolan/spark\n```\n\nRun `shards install`\n\n## Library usage\n\nRequire the shard:\n\n```crystal\nrequire \"spark\"\n```\n\nThen, use any of the fully documented modules below to interact with your user:\n\n- ⚡️ \u0026nbsp; **[Spark](https://stephendolan.github.io/spark/Spark.html)**\n  - [`.indent`](https://stephendolan.github.io/spark/Spark.html#indent-instance-method) - Increase indentation for all Spark output by one level\n  - [`.outdent`](https://stephendolan.github.io/spark/Spark.html#outdent-instance-method) - Decrease indentation for all Spark output by one level\n  - [`.reset_indentation`](https://stephendolan.github.io/spark/Spark.html#reset_indentation-instance-method) - Set the indentation level for all Spark output back to zero\n- 💬 \u0026nbsp; **[Spark::Prompt](https://stephendolan.github.io/spark/Spark/Prompt.html)**\n  - [`#say`](\u003chttps://stephendolan.github.io/spark/Spark/Prompt.html#say(message:String=%22%22,**options)-instance-method\u003e) - Display a message to a user\n  - [`#ask`](\u003chttps://stephendolan.github.io/spark/Spark/Prompt.html#ask(message:String,**options)-instance-method\u003e) - Get information from a user\n  - [`#yes?`](\u003chttps://stephendolan.github.io/spark/Spark/Prompt.html#yes?(message:String,**options)-instance-method\u003e) - Get confirmation from a user, with a default of \"Yes\"\n  - [`#no?`](\u003chttps://stephendolan.github.io/spark/Spark/Prompt.html#no?(message:String,**options)-instance-method\u003e) - Get confirmation from a user, with a default of \"No\"\n  - [`#newline`](https://stephendolan.github.io/spark/Spark/Prompt.html#newline-instance-method) - Output a blank line to the user's prompt\n- 📄 \u0026nbsp; **[Spark::Template](https://stephendolan.github.io/spark/Spark/Template.html)**\n  - [`.run_remote_file`](\u003chttps://stephendolan.github.io/spark/Spark/Template.html#run_remote_file(url:String,output:IO::FileDescriptor=STDOUT)-instance-method\u003e) - Run Crystal code from a remote source (**USE WITH CAUTION**)\n  - [`.run_local_file`](\u003chttps://stephendolan.github.io/spark/Spark/Template.html#run_local_file(file_path:String,output:IO::FileDescriptor=STDOUT)-instance-method\u003e) - Run Crystal code from a local file source (**USE WITH CAUTION**)\n- 🗄 \u0026nbsp; **[Spark::File](https://stephendolan.github.io/spark/Spark/File.html)**\n  - [`.replace_in_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#replace_in_file(relative_path:String,pattern:Regex%7CString,replacement:String)-instance-method\u003e) - Replace some content in a file\n  - [`.inject_into_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#inject_into_file(relative_path:String,*content,afterpattern:Regex%7CString)-instance-method\u003e) - Insert content into a file before or after a pattern\n  - [`.prepend_to_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#prepend_to_file(relative_path:String,*content)-instance-method\u003e) - Insert content at the beginning of a file\n  - [`.append_to_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#append_to_file(relative_path:String,*content)-instance-method\u003e) - Insert content at the end of a file\n  - [`.copy_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#copy_file(source_path:String,destination_path:String):String-instance-method\u003e) - Copy a file (very few safeguards in place currently)\n  - [`.move_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#move_file(source_path:String,destination_path:String):String-instance-method\u003e) - Move a file (very few safeguards in place currently)\n  - [`.create_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#create_file(relative_path:String,*content):String-instance-method\u003e) - Create a file (very few safeguards in place currently)\n  - [`.remove_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#remove_file(relative_path:String)-instance-method\u003e) - Remove a file\n  - [`.chmod_file`](\u003chttps://stephendolan.github.io/spark/Spark/File.html#chmod_file(file_path:String,permissions:Int%7C::File::Permissions)-instance-method\u003e) - Change the permissions of a file\n- 💎 \u0026nbsp; **[Spark::Shard](https://stephendolan.github.io/spark/Spark/Shard.html)**\n  - [`#add_shard`](\u003chttps://stephendolan.github.io/spark/Spark/Shard.html#add_shard(name:String,*,development_only:Bool=false,**options)-instance-method\u003e) - Adds a shard to the `shard.yml` file\n\n## Command line usage\n\nSpark ships with a command line interface, installed in a `postinstall` step when you `shards install`. The resulting binary will be located at `./bin/spark`.\n\nWith this CLI installed, you have access to the following commands:\n\n- `./bin/spark apply [Remote Template URL]` - Runs the content returned from the provided URL through `crystal run`\n- `./bin/spark apply --local [Local File Path]` - Runs the content of the provided file path through `crystal run`\n\n## Development\n\n1. Add your code\n1. Ensure specs pass with `crystal spec`\n1. Ensure correct formatting with `crystal tool format --check`\n1. Ensure correct style with `./bin/ameba`\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/stephendolan/spark/fork\u003e)\n1. Create your feature branch (`git checkout -b my-new-feature`)\n1. Commit your changes (`git commit -am 'Add some feature'`)\n1. Push to the branch (`git push origin my-new-feature`)\n1. Create a new Pull Request\n\n## Credits \u0026 Inspirations\n\n- [TTY](https://github.com/piotrmurach/tty) because of the excellent code and organization\n- [Thor](https://github.com/erikhuda/thor) because I've loved using it with Ruby and Rails\n- [Ameba](https://github.com/crystal-ameba/ameba) because of their excellent shard CLI\n\n## Contributors\n\n- [Stephen Dolan](https://github.com/your-github-user) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephendolan%2Fspark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephendolan%2Fspark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephendolan%2Fspark/lists"}