{"id":13507612,"url":"https://github.com/khusnetdinov/loki","last_synced_at":"2025-06-22T09:38:30.174Z","repository":{"id":57518636,"uuid":"74758849","full_name":"khusnetdinov/loki","owner":"khusnetdinov","description":":pencil: Loki is library that includes helpers for building powerful interactive command line applications, tasks, modules.","archived":false,"fork":false,"pushed_at":"2023-10-10T16:59:40.000Z","size":73,"stargazers_count":88,"open_issues_count":3,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-09T13:07:48.837Z","etag":null,"topics":["elixir","elixir-lang","elixir-library","elixir-phoenix","loki"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/khusnetdinov.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":"2016-11-25T13:01:18.000Z","updated_at":"2024-08-08T02:58:04.000Z","dependencies_parsed_at":"2024-05-01T16:19:36.382Z","dependency_job_id":"35793200-a2d0-4a14-9324-e20367822de3","html_url":"https://github.com/khusnetdinov/loki","commit_stats":{"total_commits":76,"total_committers":6,"mean_commits":"12.666666666666666","dds":"0.26315789473684215","last_synced_commit":"61944a19ce5ba8e0378edcc187e5830890afa765"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khusnetdinov%2Floki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khusnetdinov%2Floki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khusnetdinov%2Floki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khusnetdinov%2Floki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khusnetdinov","download_url":"https://codeload.github.com/khusnetdinov/loki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054194,"owners_count":21039952,"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":["elixir","elixir-lang","elixir-library","elixir-phoenix","loki"],"created_at":"2024-08-01T02:00:36.984Z","updated_at":"2025-04-09T14:15:38.402Z","avatar_url":"https://github.com/khusnetdinov.png","language":"Elixir","funding_links":[],"categories":["Command Line Applications"],"sub_categories":[],"readme":"# Loki [![Code Triagers Badge](https://www.codetriage.com/khusnetdinov/loki/badges/users.svg)](https://www.codetriage.com/khusnetdinov/loki) [![Build Status](https://travis-ci.org/khusnetdinov/loki.svg?branch=master)](https://travis-ci.org/khusnetdinov/loki) [![Hex.pm](https://img.shields.io/hexpm/v/plug.svg)](https://hex.pm/packages/loki) [![Ebert](https://ebertapp.io/github/khusnetdinov/loki.svg)](https://ebertapp.io/github/khusnetdinov/loki)\n\nLoki is a toolkit for building powerful command-line interfaces.\n\n![img](http://res.cloudinary.com/dtoqqxqjv/image/upload/v1489144587/github/loki.jpg)\n\n## Example\n\n![img](http://res.cloudinary.com/dtoqqxqjv/image/upload/v1489144586/github/1._khusnetdinov_khusnetdinov_Desktop_project_zsh_2016-12-17_09-51-12_rdjqni.png)\n\n## Instalation\n\nAdd `loki` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:loki, \"~\u003e 1.2.2\"}]\nend\n```\n\n## Usage\n\nImport all or desired module to scope:\n\n```elixir\ndefmodule Project do\n  # Import all modules\n  use Loki\n\n  # Or import single modules\n  import Loki.Shell\n  import Loki.Cmd\n  import Loki.Directory\n  import Loki.File\n  import Loki.FileManipulation\n\n  ...\n\nend\n```\n\n## Modules\n\n### Loki.Shell\nHelpers for interaction with user and printing message to shell.\n\n  - `ask/2` - Ask user input with given message. Returns tuple with parsed options.\n  - `yes?/1` - Ask about positive user input with given message.\n  - `no?/1` - Ask about negative user input with given message.\n  - `say/1` - Printing message to shell.\n  - `say_create/1` - Printing message about create file to shell.\n  - `say_force/1` -  Printing message about force action to shell.\n  - `say_identical/1` - Printing message about identical files content to shell.\n  - `say_skip/1` - Printing message about skipping action to shell.\n  - `say_error/1` - Printing message about to shell.\n  - `say_conflict/1` - Printing message about conflict to shell.\n  - `say_exists/1` - Printing message about existance to shell.\n  - `say_rename/2` - Printing message about rename files to shell.\n  - `say_copy/2` - Printing message about copy files to shell.\n  - `say_remove/1` - Printing message about removing file to shell.\n\n### Loki.Cmd\nExecuting terminal commands helpers.\n\n  - `execute/1` - Execute shell command with Env variables as options.\n  - `execute_in_path/2` - Execute shell command with Env variables as options in given path.\n  - `format_output/1` - Format execution output for reading in shell.\n\n### Loki.Directory\nWorking with folders helpers.\n\n  - `create_directory/1` - Helper for create directory.\n  - `exists_directory?/1` - Helper for checking if file exists.\n  - `copy_directory/2` - Helper for copy directory.\n  - `remove_directory/1` - Helper for remove directory.\n\n### Loki.File\nHelpers for working with file.\n\n  - `create_file/1` - Helper for create file.\n  - `create_file_force/1` - Helper for create file in force mode.\n  - `exists_file?/1` - Helper check if file exists.\n  - `identical_file?/2` - Helper check if file identical.\n  - `copy_file/2` - Helper for copy files.\n  - `create_link/2` - Helper for create link.\n  - `remove_file/1` - Helper for remove file.\n  - `rename/2` - Helper for rename files and dirs.\n\n### Loki.FileManipulation\nHelpers for content manipulation injecting, appending, and other.\n\n  - `append_to_file/2` - Helper appends lines to file.\n  - `prepend_to_file/2` - Helper prepends lines to file.\n  - `remove_from_file/2` - Helper removes lines from file.\n  - `inject_into_file/3` - Helper injecting lines to file with `before` and `after` options.\n  - `replace_in_file/3` - Helper replaces lines in file.\n  - `comment_in_file/2` - Helper comments line in file.\n  - `uncomment_in_file/2` - Helper uncomments lines in file.\n  - `remove_comments_in_file` - Helper removes all comments in file.\n\n## Documentation\n\n  [Read hexdocs.pm](https://hexdocs.pm/loki/api-reference.html)\n\n## Contribution\n\nClone repo, implement additional helpers, write tests and PR welcome!\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhusnetdinov%2Floki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhusnetdinov%2Floki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhusnetdinov%2Floki/lists"}