{"id":22360313,"url":"https://github.com/elixir-toolshed/toolshed","last_synced_at":"2025-05-15T22:05:05.321Z","repository":{"id":37886151,"uuid":"151314741","full_name":"elixir-toolshed/toolshed","owner":"elixir-toolshed","description":"A toolshed of IEx helpers","archived":false,"fork":false,"pushed_at":"2025-03-04T03:00:11.000Z","size":280,"stargazers_count":111,"open_issues_count":13,"forks_count":17,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-05T12:54:49.983Z","etag":null,"topics":["elixir","iex-helpers"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-toolshed.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-02T19:55:51.000Z","updated_at":"2025-04-07T09:24:02.000Z","dependencies_parsed_at":"2023-02-16T01:31:31.390Z","dependency_job_id":"3ad00c9f-67d0-4006-9afc-4d2ade7acbee","html_url":"https://github.com/elixir-toolshed/toolshed","commit_stats":{"total_commits":235,"total_committers":15,"mean_commits":"15.666666666666666","dds":0.3702127659574468,"last_synced_commit":"b98e3143edfef17f1044d2a129e892f4c4795b1d"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-toolshed%2Ftoolshed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-toolshed%2Ftoolshed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-toolshed%2Ftoolshed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-toolshed%2Ftoolshed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-toolshed","download_url":"https://codeload.github.com/elixir-toolshed/toolshed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253632857,"owners_count":21939379,"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","iex-helpers"],"created_at":"2024-12-04T16:15:32.427Z","updated_at":"2025-05-15T22:05:05.280Z","avatar_url":"https://github.com/elixir-toolshed.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toolshed\n\n[![CircleCI](https://circleci.com/gh/elixir-toolshed/toolshed.svg?style=svg)](https://circleci.com/gh/elixir-toolshed/toolshed)\n[![Hex version](https://img.shields.io/hexpm/v/toolshed.svg \"Hex version\")](https://hex.pm/packages/toolshed)\n\nToolshed improves the Elixir shell experience by adding a number of IEx helpers.\nThis helps when a normal Unix shell prompt isn't easily accessible like on\n[Nerves](https://nerves-project.org). It doesn't require Nerves, though, and all\nNerves-specific commands aren't even compiled if you're not using it.\n\nHere's a sample list of helpers:\n\n* `cmd` - run a command and print out the output\n* `ping` and `tcping` - check if a remote host is using ICMP or TCP\n* `ifconfig` - list network interfaces\n* `weather` - get the current weather from [wttr.in](https://wttr.in/)\n* `speed_test` - run a simple speed test to guage network throughput\n* `top` - get a list of the top processes and their OTP applications based on\n  CPU and memory\n* `tree` - list directory contents as a tree\n* `lsusb` - list USB devices\n\nTo get a complete list:\n\n```elixir\niex\u003e h Toolshed\n```\n\nTo try it out, add this project to your deps:\n\n```elixir\ndef deps do\n  [\n    {:toolshed, \"~\u003e 0.2\"}\n  ]\nend\n```\n\nRebuild and run in whatever way you prefer. At the IEx prompt, run:\n\n```elixir\niex\u003e use Toolshed\nToolshed imported. Run h(Toolshed) for more info.\n:ok\n\niex\u003e cmd(\"echo hello world\")\nhello world\n0\n\niex\u003e ping \"nerves-project.org\"\nPress enter to stop\nResponse from nerves-project.org (185.199.108.153): time=4.155ms\nResponse from nerves-project.org (185.199.108.153): time=10.385ms\nResponse from nerves-project.org (185.199.108.153): time=12.458ms\n\niex\u003e top\nOTP Application  Name or PID               Reds/Δ      Mbox/Δ     Total/Δ      Heap/Δ     Stack/Δ\nnerves_runtime   Nerves.Runtime.Kernel.UE   72M/10M     157/-32    384K/-4642  192K/73K      86/52\nsystem_registry  SystemRegistry.Global      41M/6134K     0/0      694K/192K   192K/0        35/-11\nsystem_registry  SystemRegistry.Processor   61M/6075K     0/0       73K/-1215   73K/0        10/0\nsystem_registry  SystemRegistry.Registrat 1623K/293K      1/1      211K/109K    73K/0        10/0\nsystem_registry  SystemRegistry.Processor  790K/197K     59/3     1011K/4461   502K/0        38/0\nundefined        #PID\u003c0.1793.0\u003e            221K/68K       0/0       21K/0      6772/0       504/0\nsystem_registry  SystemRegistry.Processor  382K/58K       0/0       16K/-1227  4185/-1354    22/0\nssh              #PID\u003c0.1786.0\u003e            133K/52K       0/0      4184/1599   2586/1599     10/0\nnerves_init_gadg #PID\u003c0.1432.0\u003e            213K/39K       0/0      192K/101K    73K/0        10/0\n```\n\nWhen you get tired of typing `use Toolshed`, add it to your\n[`.iex.exs`](https://hexdocs.pm/iex/IEx.html#module-the-iex-exs-file).\n\n## FAQ\n\n### I have some IEx helpers. Would you consider adding them?\n\nBased on using and maintaining Toolshed the past several years, here's what ends\nup working best:\n\n1. Wrappers for OTP functions that make them easier to remember or format their\n   output nicer for interactive use\n2. Simple implementations of shell commands that have strong muscle memory for\n   Linux users\n3. Shortcuts to Linux system features (e.g., things that read `/sys` or `/proc`)\n\nThis project is not a Busybox replacement project or an effort to replicate all\nof the functionality in shell commands. Erlang/OTP contains an awful lot of\nbuilt-in functionality. It's not identical to that provided by shell commands,\nbut if there's an easy way to get at it in an IEx helper, that's what we'd like\nto do.\n\n### A lot of these look like Unix commands? Why not run a proper shell?\n\nYeah, I miss many Unix commands when I'm at the IEx prompt. Switching to a shell\nis easy on my laptop, but on Nerves devices, it's a pain. Getting a shell prompt\non Nerves is possible, but it's limited due to Nerves not containing a full set\nof commands and it having to be run through Erlang's job control.\n\n### Why is everything compiled to `toolshed.beam`?\n\nWhen using Toolshed, the helpers are all imported into the IEx shell context for\nease of use. It looks like they're all defined in the `Toolshed` module. In\nfact, if you don't `import Toolshed` (or `use Toolshed`), you can still access\nthe helpers by calling `Toolshed.helper()`. The problem defining all of the\nhelpers in one module is that it makes `toolshed.ex` very hard to maintain.\n\nWe've experimented with many ways of maintaining the helpers, like using\n`defdelegate` and importing all of the helpers into `toolshed.ex`. There were\nseveral problems with these ways including function docs not being in the\nexpected place, code being duplicated, and manual steps. The most annoying issue\nwas that keeping helpers in lots of `.beam` files had an impact on load time on\nNerves devices. The load-time issue is being addressed in OTP 26 more\ngenerally.\n\nThe end result is that we finally settled on merging all of the helpers at\ncompile-time. The downside to this is that line numbers are wrong in stack\ntraces. Given the history of this issue, this seemed like a good compromise.\n\n### You can do so much more with some of these helpers\n\nDefinitely. There's so much that I'd like to explore, but time gets in the way.\nI'm not sold on many decisions that I made, but something was better than\nnothing. Please help me improve this or make your own IEx helpers library. I'm\nquite happy to use it too or pull it in as a dependency.\n\n### I want to use one of the functions in my program. Is the API stable?\n\nThis isn't a normal hex.pm library. Use it for the helpers. If you want\nsome code, copy and paste it or incorporate it into a library. I'd like the\nflexibility to change the API to improve interactive use.\n\n### It would be better if you changed the colors\n\nThis also isn't a question, and you've now made me regret naming the project\n`toolshed`. Please file your grievances\n[here](https://github.com/elixir-toolshed/toolshed/pull/5).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-toolshed%2Ftoolshed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-toolshed%2Ftoolshed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-toolshed%2Ftoolshed/lists"}