{"id":13398307,"url":"https://github.com/ncrocfer/clf","last_synced_at":"2025-04-05T22:09:48.086Z","repository":{"id":27798349,"uuid":"31287485","full_name":"ncrocfer/clf","owner":"ncrocfer","description":"Command line tool to search and view snippets in the terminal","archived":false,"fork":false,"pushed_at":"2015-08-04T22:04:45.000Z","size":192,"stargazers_count":348,"open_issues_count":0,"forks_count":14,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-01T10:34:47.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/ncrocfer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-24T23:28:22.000Z","updated_at":"2024-07-30T19:34:14.000Z","dependencies_parsed_at":"2022-08-19T08:10:11.672Z","dependency_job_id":null,"html_url":"https://github.com/ncrocfer/clf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrocfer%2Fclf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrocfer%2Fclf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrocfer%2Fclf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrocfer%2Fclf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncrocfer","download_url":"https://codeload.github.com/ncrocfer/clf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406111,"owners_count":20933806,"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-07-30T19:00:22.382Z","updated_at":"2025-04-05T22:09:48.064Z","avatar_url":"https://github.com/ncrocfer.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"clf - Command line tool to search snippets on Commandlinefu.com\n===============================================================\n\n.. image:: https://travis-ci.org/ncrocfer/clf.svg?branch=master\n    :target: https://travis-ci.org/ncrocfer/clf\n\n\n`Commandlinefu.com \u003chttp://www.commandlinefu.com/\u003e`_ is the place to record awesome command-line snippets. This tool allows you to search and view the results into your terminal.\n\n**Example 1**\n\n.. code-block:: shell\n\n    $ clf python server\n\n      # python smtp server\n      python -m smtpd -n -c DebuggingServer localhost:1025\n\n      # Python version 3: Serve current directory tree at http://$HOSTNAME:8000/\n      python -m http.server\n\n      # Start a HTTP server which serves Python docs\n      pydoc -p 8888 \u0026 gnome-open http://localhost:8888\n\n      # put current directory in LAN quickly\n      python -m SimpleHTTPServer\n\n**Example 2**\n\n.. code-block:: shell\n\n    $ clf recursive line count\n\n      # Recursive Line Count\n      find ./ -not -type d | xargs wc -l | cut -c 1-8 | awk '{total += $1} END {print total}'\n\n      # Recursive Line Count\n      find * -type f -not -name \".*\" | xargs wc -l\n\n      # Get Total Line Count Of All Files In Subdirectory (Recursive)\n      find . -type f -name \"*.*\" -exec cat {} \u003e totalLines 2\u003e /dev/null \\; \u0026\u0026 wc -l totalLines \u0026\u0026 rm totalLines\n\n      # Recursive Line Count\n      wc -l `find . -name *.php`\n\nInstallation\n------------\n\nThe tool works with Python 2 and Python 3. It can be installed with `Pip` :\n\n::\n\n    pip install clf\n\nUsage\n-----\n\n::\n\n    Command line tool to search snippets on Commandlinefu.com\n\n    Usage:\n      clf [options]\n      clf \u003ccommand\u003e [options]\n      clf \u003ckeyword\u003e \u003ckeyword\u003e... [options]\n    \n    Options:\n      -h, --help      Show this help.\n      -v, --version   Show version.\n      -c, --color     Enable colorized output.\n      -i, --id        Show the snippets id.\n      -n NUMBER       Show the n first snippets [default: 25].\n      --order=ORDER   The order output (votes|date) [default: votes].\n      --proxy=PROXY   The proxy used to perform requests.\n    \n    Examples:\n      clf tar\n      clf python server\n      clf tar --proxy=http://127.0.0.1:8080\n      clf --order=date -n 3\n\nNotes\n-----\n\n**Enable the colorized output**\n\nYou can set the :code:`CLF_COLOR` environment variable to enable the colorized output by default :\n\n::\n\n    $ export CLF_COLOR=1\n\n**Use clf in your scripts**\n\nYou can import the :code:`clf` module and use it in your own scripts :\n\n.. code-block:: python\n\n    #!/usr/bin/env python\n\n    from clf import Clf\n\n    c = Clf()\n    for cmd in c.browse():\n        print(\"#{}\\n{}\\n\".format(\n            cmd.summary,\n            cmd.command\n        ))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrocfer%2Fclf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncrocfer%2Fclf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrocfer%2Fclf/lists"}