create account

Adding search to the flatpak cli by tingping

View this thread on: hive.blogpeakd.comecency.com
· @tingping · (edited)
$35.32
Adding search to the flatpak cli
The CLI experience provided by flatpak is not the most user friendly experience and part of the problem was difficulty in discovering applications. Previously the only data it exposed access to was the [OSTree](https://ostree.readthedocs.io/en/latest/) metadata which didn't include much human friendly information.

Thankfully applications can provide [AppStream metadata](https://www.freedesktop.org/software/appstream/docs/) which was designed exactly for exposing information to users. With this information and a new dependency on [appstream-glib](https://people.freedesktop.org/~hughsient/appstream-glib/) we can add a `search` command to `flatpak` that loads up the appstream data for each configured remote and then searches through it matching the descriptions and names of applications.

A video of search in action:

[![asciicast](https://asciinema.org/a/kDFWduSJgfzENAJ2p4u0nMzUc.png)](https://asciinema.org/a/kDFWduSJgfzENAJ2p4u0nMzUc)

The main difficulties were providing enough information in the results to be useful, as the `flatpak` commands are a bit more verbose than other package managers, while not being overwhelming with information. Also a lot of packages don't include version information which is slowly being solved in existing packages.

Merge request: https://github.com/flatpak/flatpak/pull/1136

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@tingping/adding-search-to-the-flatpak-cli">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , ,
properties (23)
authortingping
permlinkadding-search-to-the-flatpak-cli
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":59213200,"name":"flatpak","full_name":"flatpak/flatpak","owner":{"login":"flatpak","id":19473042,"avatar_url":"https://avatars0.githubusercontent.com/u/19473042?v=4","gravatar_id":"","url":"https://api.github.com/users/flatpak","html_url":"https://github.com/flatpak","followers_url":"https://api.github.com/users/flatpak/followers","following_url":"https://api.github.com/users/flatpak/following{/other_user}","gists_url":"https://api.github.com/users/flatpak/gists{/gist_id}","starred_url":"https://api.github.com/users/flatpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flatpak/subscriptions","organizations_url":"https://api.github.com/users/flatpak/orgs","repos_url":"https://api.github.com/users/flatpak/repos","events_url":"https://api.github.com/users/flatpak/events{/privacy}","received_events_url":"https://api.github.com/users/flatpak/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flatpak/flatpak","description":"Linux application sandboxing and distribution framework (formerly xdg-app)","fork":false,"url":"https://api.github.com/repos/flatpak/flatpak","forks_url":"https://api.github.com/repos/flatpak/flatpak/forks","keys_url":"https://api.github.com/repos/flatpak/flatpak/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flatpak/flatpak/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flatpak/flatpak/teams","hooks_url":"https://api.github.com/repos/flatpak/flatpak/hooks","issue_events_url":"https://api.github.com/repos/flatpak/flatpak/issues/events{/number}","events_url":"https://api.github.com/repos/flatpak/flatpak/events","assignees_url":"https://api.github.com/repos/flatpak/flatpak/assignees{/user}","branches_url":"https://api.github.com/repos/flatpak/flatpak/branches{/branch}","tags_url":"https://api.github.com/repos/flatpak/flatpak/tags","blobs_url":"https://api.github.com/repos/flatpak/flatpak/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flatpak/flatpak/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flatpak/flatpak/git/refs{/sha}","trees_url":"https://api.github.com/repos/flatpak/flatpak/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flatpak/flatpak/statuses/{sha}","languages_url":"https://api.github.com/repos/flatpak/flatpak/languages","stargazers_url":"https://api.github.com/repos/flatpak/flatpak/stargazers","contributors_url":"https://api.github.com/repos/flatpak/flatpak/contributors","subscribers_url":"https://api.github.com/repos/flatpak/flatpak/subscribers","subscription_url":"https://api.github.com/repos/flatpak/flatpak/subscription","commits_url":"https://api.github.com/repos/flatpak/flatpak/commits{/sha}","git_commits_url":"https://api.github.com/repos/flatpak/flatpak/git/commits{/sha}","comments_url":"https://api.github.com/repos/flatpak/flatpak/comments{/number}","issue_comment_url":"https://api.github.com/repos/flatpak/flatpak/issues/comments{/number}","contents_url":"https://api.github.com/repos/flatpak/flatpak/contents/{+path}","compare_url":"https://api.github.com/repos/flatpak/flatpak/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flatpak/flatpak/merges","archive_url":"https://api.github.com/repos/flatpak/flatpak/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flatpak/flatpak/downloads","issues_url":"https://api.github.com/repos/flatpak/flatpak/issues{/number}","pulls_url":"https://api.github.com/repos/flatpak/flatpak/pulls{/number}","milestones_url":"https://api.github.com/repos/flatpak/flatpak/milestones{/number}","notifications_url":"https://api.github.com/repos/flatpak/flatpak/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flatpak/flatpak/labels{/name}","releases_url":"https://api.github.com/repos/flatpak/flatpak/releases{/id}","deployments_url":"https://api.github.com/repos/flatpak/flatpak/deployments","created_at":"2016-05-19T14:19:21Z","updated_at":"2017-12-25T06:42:46Z","pushed_at":"2017-12-21T18:30:56Z","git_url":"git://github.com/flatpak/flatpak.git","ssh_url":"git@github.com:flatpak/flatpak.git","clone_url":"https://github.com/flatpak/flatpak.git","svn_url":"https://github.com/flatpak/flatpak","homepage":"http://flatpak.org","size":9831,"stargazers_count":1175,"watchers_count":1175,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":123,"mirror_url":null,"archived":false,"open_issues_count":253,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":123,"open_issues":253,"watchers":1175,"default_branch":"master","score":123.31392},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","linux","flatpak","technology"],"users":["tingping"],"links":["https://ostree.readthedocs.io/en/latest/","https://www.freedesktop.org/software/appstream/docs/","https://people.freedesktop.org/~hughsient/appstream-glib/","https://asciinema.org/a/kDFWduSJgfzENAJ2p4u0nMzUc.png"],"image":["https://asciinema.org/a/kDFWduSJgfzENAJ2p4u0nMzUc.png"]}"
created2017-12-25 10:33:15
last_update2017-12-25 13:10:51
depth0
children7
last_payout2018-01-01 10:33:15
cashout_time1969-12-31 23:59:59
total_payout_value24.563 HBD
curator_payout_value10.760 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,500
author_reputation637,453,434,557
root_title"Adding search to the flatpak cli"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,148,875
net_rshares7,764,646,463,546
author_curate_reward""
vote details (6)
@codingdefined ·
Your contribution cannot be approved yet because it does not have **proof of work** because if your username in Utopian does not match that of Github, you need to provide logged in session of your Github Account and show the projects. 

See the [Utopian Rules](https://utopian.io/rules). Please edit your contribution and add **proof** (links, screenshots, commits, etc) of your work, to reapply for approval.

You may edit your post [here](https://utopian.io/utopian-io/@tingping/adding-search-to-the-flatpak-cli), as shown below: 
![](https://res.cloudinary.com/hpiynhbhq/image/upload/v1509788371/nbgbomithszxs3nxq6gx.png)

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
authorcodingdefined
permlinkre-tingping-adding-search-to-the-flatpak-cli-20171228t044015002z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-28 04:40:15
last_update2017-12-28 04:40:15
depth1
children2
last_payout2018-01-04 04:40:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length743
author_reputation534,412,532,689,656
root_title"Adding search to the flatpak cli"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,627,530
net_rshares0
@tingping ·
You are mistaken, the linked PR is by "TingPing" the same name here and linked with this account.
properties (22)
authortingping
permlinkre-codingdefined-re-tingping-adding-search-to-the-flatpak-cli-20171228t115306186z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-28 11:53:06
last_update2017-12-28 11:53:06
depth2
children1
last_payout2018-01-04 11:53:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length97
author_reputation637,453,434,557
root_title"Adding search to the flatpak cli"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,675,986
net_rshares0
@codingdefined ·
Yeah Sorry, my bad. Accepted the contribution.
properties (22)
authorcodingdefined
permlinkre-tingping-re-codingdefined-re-tingping-adding-search-to-the-flatpak-cli-20171228t141621019z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-28 14:16:21
last_update2017-12-28 14:16:21
depth3
children0
last_payout2018-01-04 14:16:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length46
author_reputation534,412,532,689,656
root_title"Adding search to the flatpak cli"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,695,809
net_rshares0
@codingdefined ·
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
authorcodingdefined
permlinkre-tingping-adding-search-to-the-flatpak-cli-20171228t141544863z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-28 14:15:48
last_update2017-12-28 14:15:48
depth1
children0
last_payout2018-01-04 14:15:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length172
author_reputation534,412,532,689,656
root_title"Adding search to the flatpak cli"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,695,712
net_rshares0
@tingping ·
@originalworks
properties (22)
authortingping
permlinkre-tingping-adding-search-to-the-flatpak-cli-20171226t175555410z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-26 17:55:54
last_update2017-12-26 17:55:54
depth1
children1
last_payout2018-01-02 17:55:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length15
author_reputation637,453,434,557
root_title"Adding search to the flatpak cli"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,377,719
net_rshares0
@originalworks ·
originalworks
The @OriginalWorks bot has determined this post by @tingping to be original material and upvoted it! 
<center>![ezgif.com-resize.gif](https://steemitimages.com/DQmaBi37A5oTnQ9NBLH8YU4jpvhhmFauyvgg3YRrEJwskM9/ezgif.com-resize.gif)</center> 

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!
properties (22)
authororiginalworks
permlinkre-re-tingping-adding-search-to-the-flatpak-cli-20171226t175555410z-20171226t181301
categoryutopian-io
json_metadata"{"app": "pysteem/0.5.4"}"
created2017-12-26 18:13:03
last_update2017-12-26 18:13:03
depth2
children0
last_payout2018-01-02 18:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length344
author_reputation79,292,026,602,057
root_title"Adding search to the flatpak cli"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,380,143
net_rshares0
@utopian-io ·
### Hey @tingping I am @utopian-io. I have just upvoted you!
#### Achievements
- You have less than 500 followers. Just gave you a gift to help you succeed!
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-tingping-adding-search-to-the-flatpak-cli-20171229t091436519z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-29 09:14:36
last_update2017-12-29 09:14:36
depth1
children0
last_payout2018-01-05 09:14:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,084
author_reputation152,955,367,999,756
root_title"Adding search to the flatpak cli"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,837,501
net_rshares0